Commits

Ben Bangert committed 977acf9

Set path properly

  • Participants
  • Parent commits daa62c9

Comments (0)

Files changed (1)

beaker/session.py

     domain = property(_get_domain, _set_domain)
 
     def _set_path(self, path):
-        self['_path'] = path
+        self['_path'] = self._path = path
         self.cookie[self.key]['path'] = path
         self._update_cookie_out()
 
 
                 # Update the current _accessed_time
                 session_data['_accessed_time'] = now
+                
+                # Set the path if applicable
+                if '_path' in session_data:
+                    self._path = session_data['_path']
                 self.update(session_data)
                 self.accessed_dict = session_data.copy()
         finally:
             self.is_new = False
             try:
                 self.update(self._decrypt_data())
+                self._path = self.get('_path', '/')
             except:
                 pass
             if self.timeout is not None and time.time() - \
     domain = property(_get_domain, _set_domain)
 
     def _set_path(self, path):
-        self['_path'] = path
-        self._path = path
+        self['_path'] = self._path = path
 
     def _get_path(self):
         return self._path