Changeset 582
- Timestamp:
- 08/31/05 11:19:49
- Files:
-
- trunk/cherrypy/lib/filter/sessionfilter.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/filter/sessionfilter.py
r581 r582 28 28 29 29 """ Session implementation for CherryPy. 30 We use cherrypy.threadData (td) to store some sonvenient variables as30 We use cherrypy.threadData (td) to store some convenient variables as 31 31 well as data about the session for the current request. 32 32 33 33 Variables used to store config options: 34 35 34 - td._sessionTimeout: timeout delay for the session 36 35 - td._sessionLocking: mechanism used to lock the session ('implicit' or 'explicit') … … 125 124 td._sessionID, (td._sessionData, expirationTime)) 126 125 try: 127 # Always try to release the lock inthe end126 # Always try to release the lock at the end 128 127 td._sessionStorage.releaseLock() 129 128 except: … … 141 140 class RamStorage: 142 141 """ Implementation of the RAM backend for sessions """ 142 def __init__(self): 143 try: 144 cherrypy._sessionDataHolder 145 except: 146 cherrypy._sessionDataHolder = {} 147 try: 148 cherrypy._sessionLockDict 149 except: 150 cherrypy._sessionLockDict = {} 151 143 152 def load(self, id): 144 try:145 cherrypy._sessionDataHolder146 except:147 cherrypy._sessionDataHolder = {}148 153 return cherrypy._sessionDataHolder.get(id) 149 154 def save(self, id, data): 150 try:151 cherrypy._sessionDataHolder152 except:153 cherrypy._sessionDataHolder = {}154 155 cherrypy._sessionDataHolder[id] = data 155 156 def acquireLock(self): 156 try:157 cherrypy._sessionLockDict158 except:159 cherrypy._sessionLockDict = {}160 157 id = cherrypy.session['_id'] 161 158 lock = cherrypy._sessionLockDict.get(id)

