mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 22:44:24 +01:00
Make login sessions permanent (#1991)
* Closes #1990 * Make session cookies persist in the browser after close
This commit is contained in:
@@ -15,6 +15,7 @@ def login_user(user):
|
||||
session["id"] = user.id
|
||||
session["nonce"] = generate_nonce()
|
||||
session["hash"] = hmac(user.password)
|
||||
session.permanent = True
|
||||
|
||||
# Clear out any currently cached user attributes
|
||||
clear_user_session(user_id=user.id)
|
||||
@@ -23,6 +24,7 @@ def login_user(user):
|
||||
def update_user(user):
|
||||
session["id"] = user.id
|
||||
session["hash"] = hmac(user.password)
|
||||
session.permanent = True
|
||||
|
||||
# Clear out any currently cached user attributes
|
||||
clear_user_session(user_id=user.id)
|
||||
|
||||
Reference in New Issue
Block a user