Session cookie is not persistent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
web.py |
New
|
Undecided
|
Unassigned |
Bug Description
Sometimes it would be useful to have a "remember me" option.
This patch allows to specify the persistance of the session cookie per-user.
Eg.:
--- a/web/session.py
+++ b/web/session.py
@@ -105,7 +105,10 @@ class Session(
if not self.get(
- web.setcookie(
+ if self.get(
+ web.setcookie(
+ else:
+ web.setcookie(
else:
Thanks for this patch! Persistent sessions is something most people will want to have.
Why is it not in the main repository? I think it's rather inconvenient to have to patch your web.py install to do that quite important thing.
Finally, here's how to use the persistent sessions:
1. Apply patch
2. Inside the handler class where you setup the user's session, just add "session.persistent = True"