Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #2133 -- Invalid session cookie no longer causes fatal error. T…

…hanks, greg-django@abbas.org

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4423 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9d9435588505a9e4c46af6a774ef5fb3dadf53db 1 parent 81c8390
@adrianholovaty adrianholovaty authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/contrib/sessions/middleware.py
View
3  django/contrib/sessions/middleware.py
@@ -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 @@ def _get_session(self):
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.
Please sign in to comment.
Something went wrong with that request. Please try again.