pyramid_cubicweb/login.py
changeset 11509 ca3412269cd1
parent 11497 855219da7c70
child 11527 aa05b41a5816
equal deleted inserted replaced
11508:ef8b9021b47b 11509:ca3412269cd1
    31             "Authentication failed. Please check your credentials."))
    31             "Authentication failed. Please check your credentials."))
    32         request.cw_request.post = dict(request.params)
    32         request.cw_request.post = dict(request.params)
    33         del request.cw_request.post['__password']
    33         del request.cw_request.post['__password']
    34         return login_form(request)
    34         return login_form(request)
    35 
    35 
    36     headers = security.remember(request, user_eid)
    36     max_age = None
       
    37     if request.params.get('__setauthcookie') == '1':
       
    38         max_age = '604800'
       
    39     headers = security.remember(request, user_eid, max_age=max_age)
    37 
    40 
    38     new_path = request.params.get('postlogin_path', '/')
    41     new_path = request.params.get('postlogin_path', '/')
    39 
    42 
    40     if new_path == 'login':
    43     if new_path == 'login':
    41         new_path = '/'
    44         new_path = '/'