Hi all,
as now I see that the server side sessions expire after the "timeout"
value, configurable into web.config.session_parameters, and the client
side after the browser shutdown (firefox say me "to the end of
session"). Looking inside the code, I see that with a simple modify
it's possible to set the life of the client cookie, so I post here
simple code that add the "expire" value to the cookie.
michele:~/webpy/web$ diff session.py.orig session.py
24a25,26
> expires = datetime.datetime.now() + datetime.timedelta(hours=24)
>
32a35
> 'expires': expires.strftime('%a, %d %b %Y %H:%M:%S')
101a105
> expires = self._config.expires
103c107
< web.setcookie(cookie_name, self.session_id,
domain=cookie_domain)
---
> web.setcookie(cookie_name, self.session_id, expires=expires,
> domain=cookie_domain)
Ok, it's not so completely clean, because (I think) that the expire
time must to be the same than the timeout (a function that set both
values?), but can be a start. Or not?
Thanks,
Michele
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---