changeset 303:a99631597f65

don't expire cookies soon
author Matt Johnston <matt@ucc.asn.au>
date Tue, 23 Jul 2019 22:44:24 +0800
parents ef407d48cbe5
children 02aff9ff8d24
files web/secure.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
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):