Fixed a subtle corner case whereby sending a bad session ID generates new (unused) session entries in the database table.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7001 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
70fe1ef262
commit
041e24dbde
|
@ -26,6 +26,8 @@ class SessionStore(SessionBase):
|
||||||
|
|
||||||
# Save immediately to minimize collision
|
# Save immediately to minimize collision
|
||||||
self.save()
|
self.save()
|
||||||
|
# Ensure the user is notified via a new cookie.
|
||||||
|
self.modified = True
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def exists(self, session_key):
|
def exists(self, session_key):
|
||||||
|
|
|
@ -46,6 +46,8 @@ class SessionStore(SessionBase):
|
||||||
self._session_key = self._get_new_session_key()
|
self._session_key = self._get_new_session_key()
|
||||||
self._session_cache = {}
|
self._session_cache = {}
|
||||||
self.save()
|
self.save()
|
||||||
|
# Ensure the user is notified via a new cookie.
|
||||||
|
self.modified = True
|
||||||
finally:
|
finally:
|
||||||
session_file.close()
|
session_file.close()
|
||||||
except(IOError):
|
except(IOError):
|
||||||
|
|
Loading…
Reference in New Issue