Issue #870 resolved

Support "session cookies" which flush on browser close

guest
created an issue

In order to expire session cookies on browser close, it was suggested to use tools.sessions.timeout: None. However this produces a server fault.

{{{ Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/cherrypy/_cprequest.py", line 609, in respond self.hooks.run('before_finalize') File "/usr/lib/python2.5/site-packages/cherrypy/_cprequest.py", line 98, in run hook() File "/usr/lib/python2.5/site-packages/cherrypy/_cprequest.py", line 58, in call return self.callback(*self.kwargs) File "/usr/lib/python2.5/site-packages/cherrypy/lib/sessions.py", line 565, in save cherrypy.session.save() File "/usr/lib/python2.5/site-packages/cherrypy/lib/sessions.py", line 123, in save t = datetime.timedelta(seconds = self.timeout * 60) TypeError: unsupported operand type(s) for : 'NoneType' and 'int' }}}

Comments (2)

  1. Robert Brewer

    Fixed in [2062] via a new `tools.sessions.persistent` arg; default is True--set to False to retain a timeout on session storage but omit the `expires` param in the cookie.

  2. Log in to comment