save “stay_logged_in” in the session
Since sessions are rebuilt, e.g. when you try to post a blank comment and therefore receive an error message, the session will be overwritten without the old max_age.
This commit is contained in:
committed by
Rodney Ewing
parent
527b7e3b57
commit
ef57b0622c
@@ -89,7 +89,7 @@ def login(request):
|
||||
if user:
|
||||
# set up login in session
|
||||
if login_form.stay_logged_in.data:
|
||||
request.session.max_age = 30 * 24 * 60 * 60
|
||||
request.session['stay_logged_in'] = True
|
||||
request.session['user_id'] = unicode(user.id)
|
||||
request.session.save()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user