so .. I am having a tough time getting on_delete_session working in firefox, though it works in IE. here is a dummy app, which seems to explain my woes. when I open up the "admin" page in IE , refresh a few times, I watch the "count" variable increment. I close the window. open Ie again, go to the admin page and the count is at zero, as expected. in firefox, i do the same, and the count never resets to zero. can Anyone help? also, my config file is below. =============================== class CAMAdmin(cpbase.CPBase): 35 """ 36 """ 37 38 #------------------------------------- 39 def __init__(self): 40 self._AppName = "CAM Management Administration" 41 self._AppDescription = "Manage CAM application version sets and track CAM users" 42 self.environment = getConfigProperty('environment') 43 cherrypy.config.update({'sessionFilter.on_delete_session': self.onDeleteSession}) 44 45 #-------------------------------------------------------------------------- 46 def onDeleteSession(self, sess): 47 """called by cherrypy when session is being deleted 48 cherrypy passes tuple (a,b) to this proc; a = session dict, b = timestamp 49 checks to see if open db connection exists, and if so, closes it 50 """ 51 assert sess is not None 52 assert type(sess) == type(tuple()), str(sess) 53 assert type(sess[0] == type({})) 54 self.setSessionKeyValue('count', 'None') 55 56 #------------------------------------- 57 58 def admin(self): 59 """ 60 """ 61 count = self.getSessionKeyValue('count') 62 if count is None: 63 count = 0 64 else: 65 count += 1 66 self.setSessionKeyValue('count', count) 67 return "you've been to this page %s times" % count 68 69 admin.exposed = True 70 77 78 if __name__ == '__main__': 79 cherrypy.root = CAMAdmin() 80 cherrypy.config.update(file = 'cam-admin.conf') 81 cherrypy.server.start() ====================================== 1 [global] 2 server.socketPort = 10078 3 server.threadPool = 3 4 server.environment="production" 5 StaticFilter.root = "." 6 server.logFile = "debug.log" 7 8 sessionFilter.on = True 9 sessionFilter.storageType = 'Ram' 10 sessionFilter.timeout = 30 # in minutes 11 sessionFilter.cleanUpDelay = 5 12 13 [/style.css] 14 staticFilter.on = True 15 staticFilter.file = "/var/www/style.css" 16 17 [/scripts] 18 staticFilter.on = True 19 staticFilter.dir = "/var/www/scripts/" 20 21 [/usericon.gif] 22 staticFilter.on = True 23 staticFilter.file = "usericon.gif" 24 25 [/insticon.gif] 26 staticFilter.on = True 27 staticFilter.file = "insticon.gif" --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cherrypy-devel" group. To post to this group, send email to [hidden email] To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cherrypy-devel -~----------~----~----~----~------~----~------~--~--- |
Free forum by Nabble | Edit this page |