Ticket #5816: 5816.diff
File 5816.diff, 1.2 KB (added by , 17 years ago) |
---|
-
django/contrib/sessions/middleware.py
1 1 from django.conf import settings 2 2 from django.utils.cache import patch_vary_headers 3 3 from email.Utils import formatdate 4 import datetime5 4 import time 6 5 7 6 TEST_COOKIE_NAME = 'testcookie' … … 34 33 35 34 # Fixed length date must have '-' separation in the format 36 35 # DD-MMM-YYYY for compliance with Netscape cookie standard 37 expires = datetime.datetime.strftime(datetime.datetime.utcnow() + \38 datetime.timedelta(seconds=settings.SESSION_COOKIE_AGE), "%a, %d-%b-%Y %H:%M:%S GMT")39 36 # Note: strftime cannot be used here since it is locale-dependent 37 expires = (rfcdate[:7] + "-" + rfcdate[8:11] 38 + "-" + rfcdate[12:26] + "GMT") 40 39 # Save the seesion data and refresh the client cookie. 41 40 request.session.save() 42 41 response.set_cookie(settings.SESSION_COOKIE_NAME,