Hi Nick
I think that the point of Michel is that the expiration date of the
session gets updated every time that the user make a request with the
same session_id, so for example:
tools.session.timeout = 300 # 5hours
1. User <no cookies>
Server response with "Set-Cookie" sess_id=1 and expires=now()+timeout
2. User <cookie: session_id=1>
Server response
with "Set-Cookie" sess_id=1 and expires = now() + timeout
== After 4 hours:
The same session id is "refreshed",
3. User <cookie: session_id=1>
Server response
with "Set-Cookie" sess_id=1 and expires = now() + timeout
== After 6 hours:
4. User <cookie: session_id=1>
# session_id is EXPIRED!, more than 5 hours since the last visit.
Server response
with "Set-Cookie" sess_id=58 and expires = now() + timeout
# Now the user had a new session id, because the first one has expired,
# The used did not visit the page in less than `timeout`.
You can check the headers is every request there is a "Set-Cookie" with
the same session_id but with a new expires.
So that's the reason that it will be easier to implement with a
particular cookie with fixed expires, you control the expiration date
not the session (which update the expiration date of the cookie in every
request).
At least that what is see in the cherrypy source code,
`cherrypy.lib.sessions.init` gets hooked to the point
'before_request_body' in the session tool and the last statement of that
function is `set_response_cookie` with the new timeout.
I hope this clarify a little bit more the situation.
Cheers.
> --
> You received this message because you are subscribed to the Google
> Groups "cherrypy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
cherrypy-user...@googlegroups.com.
> To post to this group, send email to
cherryp...@googlegroups.com.
> Visit this group at
>
http://groups.google.com/group/cherrypy-users?hl=en.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>
--
Rivera²