Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Adrian Holovaty authored January 25, 2007

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  django/contrib/sessions/middleware.py
3  django/contrib/sessions/middleware.py
... ...
@@ -1,5 +1,6 @@
1 1
 from django.conf import settings
2 2
 from django.contrib.sessions.models import Session
  3
+from django.core.exceptions import SuspiciousOperation
3 4
 from django.utils.cache import patch_vary_headers
4 5
 import datetime
5 6
 
@@ -55,7 +56,7 @@ def _get_session(self):
55 56
                     s = Session.objects.get(session_key=self.session_key,
56 57
                         expire_date__gt=datetime.datetime.now())
57 58
                     self._session_cache = s.get_decoded()
58  
-                except Session.DoesNotExist:
  59
+                except (Session.DoesNotExist, SuspiciousOperation):
59 60
                     self._session_cache = {}
60 61
                     # Set the session_key to None to force creation of a new
61 62
                     # key, for extra security.

0 notes on commit 9d94355

Please sign in to comment.
Something went wrong with that request. Please try again.