Commit 041e24db authored by Malcolm Tredinnick's avatar Malcolm Tredinnick
Browse files

Fixed a subtle corner case whereby sending a bad session ID generates new...

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
parent 70fe1ef2
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ class SessionStore(SessionBase):

            # Save immediately to minimize collision
            self.save()
            # Ensure the user is notified via a new cookie.
            self.modified = True
            return {}

    def exists(self, session_key):
+11 −9
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ class SessionStore(SessionBase):
                    self._session_key = self._get_new_session_key()
                    self._session_cache = {}
                    self.save()
                    # Ensure the user is notified via a new cookie.
                    self.modified = True
            finally:
                session_file.close()
        except(IOError):