Set expiration properly on session cookies.
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 5 Aug 2012 05:41:07 +0000 (07:41 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 5 Aug 2012 05:41:07 +0000 (07:41 +0200)
wrw/session.py

index 273775b..43b9087 100644 (file)
@@ -168,7 +168,9 @@ class db(object):
         return session(threading.RLock())
 
     def mkcookie(self, req, sess):
-        cookie.add(req, self.cookiename, sess.id, path=self.path)
+        cookie.add(req, self.cookiename, sess.id,
+                   path=self.path,
+                   expires=cookie.cdate(time.time() + sess.expire))
 
     def fetch(self, req):
         now = int(time.time())