diff web/secure.py @ 303:a99631597f65

don't expire cookies soon
author Matt Johnston <matt@ucc.asn.au>
date Tue, 23 Jul 2019 22:44:24 +0800
parents f7261dd970da
children 87c20b8c5472
line wrap: on
line diff
--- a/web/secure.py	Tue Jul 23 22:44:12 2019 +0800
+++ b/web/secure.py	Tue Jul 23 22:44:24 2019 +0800
@@ -36,7 +36,8 @@
     c = bottle.request.get_cookie(AUTH_COOKIE)
     if not c:
         c = binascii.hexlify(os.urandom(AUTH_COOKIE_LEN))
-        bottle.response.set_cookie(AUTH_COOKIE, c, secure=True, httponly=True)
+        years = 60*60*24*365
+        bottle.response.set_cookie(AUTH_COOKIE, c, secure=True, httponly=True, max_age=10*years)
     return cookie_hash(c)
 
 def check_cookie(allowed_users):