pyramid_cubicweb/login.py
changeset 11509 ca3412269cd1
parent 11497 855219da7c70
child 11527 aa05b41a5816
--- a/pyramid_cubicweb/login.py	Thu Sep 18 15:07:02 2014 +0200
+++ b/pyramid_cubicweb/login.py	Thu Sep 18 16:51:55 2014 +0200
@@ -33,7 +33,10 @@
         del request.cw_request.post['__password']
         return login_form(request)
 
-    headers = security.remember(request, user_eid)
+    max_age = None
+    if request.params.get('__setauthcookie') == '1':
+        max_age = '604800'
+    headers = security.remember(request, user_eid, max_age=max_age)
 
     new_path = request.params.get('postlogin_path', '/')