Support "session cookies" which flush on browser close

guest avatarguest 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/", line 609, in respond'before_finalize')
  File "/usr/lib/python2.5/site-packages/cherrypy/", line 98, in run
  File "/usr/lib/python2.5/site-packages/cherrypy/", line 58, in __call__
    return self.callback(**self.kwargs)
  File "/usr/lib/python2.5/site-packages/cherrypy/lib/", line 565, in save
  File "/usr/lib/python2.5/site-packages/cherrypy/lib/", 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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.