Commits

Ben Bangert  committed a3fa827

Bug fix for cookie sessions to retain id before clearing values

  • Participants
  • Parent commits 57eb4a0
  • Tags v1.0.1

Comments (0)

Files changed (1)

File beaker/session.py

     def delete(self):
         """Deletes the session from the persistent storage, and sends
         an expired cookie out"""
+        if self.use_cookies:
+            self._delete_cookie()
         self.namespace.acquire_write_lock()
         try:
             self.namespace.remove()
         finally:
             self.namespace.release_write_lock()
-        if self.use_cookies:
-            self._delete_cookie()
 
     def _delete_cookie(self):
         self.request['set_cookie'] = True
     
     def delete(self):
         # Send a delete cookie request
+        self._delete_cookie()
         self.clear()
-        self._delete_cookie()
     
     # Alias invalidate to delete
     invalidate = delete