Author: adrian
Date: 2007-01-24 18:47:44 -0600 (Wed, 24 Jan 2007)
New Revision: 4423
Modified:
django/trunk/django/contrib/sessions/middleware.py
Log:
Fixed #2133 -- Invalid session cookie no longer causes fatal error. Thanks,
[EMAIL PROTECTED]
Modified: django/trunk/django/contrib/sessions/middleware.py
===================================================================
--- django/trunk/django/contrib/sessions/middleware.py 2007-01-25 00:43:44 UTC
(rev 4422)
+++ django/trunk/django/contrib/sessions/middleware.py 2007-01-25 00:47:44 UTC
(rev 4423)
@@ -1,5 +1,6 @@
from django.conf import settings
from django.contrib.sessions.models import Session
+from django.core.exceptions import SuspiciousOperation
from django.utils.cache import patch_vary_headers
import datetime
@@ -55,7 +56,7 @@
s = Session.objects.get(session_key=self.session_key,
expire_date__gt=datetime.datetime.now())
self._session_cache = s.get_decoded()
- except Session.DoesNotExist:
+ except (Session.DoesNotExist, SuspiciousOperation):
self._session_cache = {}
# Set the session_key to None to force creation of a new
# key, for extra security.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---