Fixed imports, indention, and a long line.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6628 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
48ce8456cb
commit
a7a6a1b75d
|
@ -1,8 +1,9 @@
|
||||||
|
import time
|
||||||
|
import datetime
|
||||||
|
from email.Utils import formatdate
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.cache import patch_vary_headers
|
from django.utils.cache import patch_vary_headers
|
||||||
from email.Utils import formatdate
|
|
||||||
import datetime
|
|
||||||
import time
|
|
||||||
|
|
||||||
TEST_COOKIE_NAME = 'testcookie'
|
TEST_COOKIE_NAME = 'testcookie'
|
||||||
TEST_COOKIE_VALUE = 'worked'
|
TEST_COOKIE_VALUE = 'worked'
|
||||||
|
@ -10,8 +11,9 @@ TEST_COOKIE_VALUE = 'worked'
|
||||||
class SessionMiddleware(object):
|
class SessionMiddleware(object):
|
||||||
|
|
||||||
def process_request(self, request):
|
def process_request(self, request):
|
||||||
engine = __import__(settings.SESSION_ENGINE, {}, {}, [''])
|
engine = __import__(settings.SESSION_ENGINE, {}, {}, [''])
|
||||||
request.session = engine.SessionStore(request.COOKIES.get(settings.SESSION_COOKIE_NAME, None))
|
session_key = request.COOKIES.get(settings.SESSION_COOKIE_NAME, None)
|
||||||
|
request.session = engine.SessionStore(session_key)
|
||||||
|
|
||||||
def process_response(self, request, response):
|
def process_response(self, request, response):
|
||||||
# If request.session was modified, or if response.session was set, save
|
# If request.session was modified, or if response.session was set, save
|
||||||
|
|
Loading…
Reference in New Issue