Flask Logout If Sessions Expires If No Activity And Redirect For Login Page
I'm very new to flask and trying updating a website with flask where users have accounts and are able to login. I want to make user session expire and logout if there is no activit
Solution 1:
You can use permanent_session_lifetime and the session.modified flag as described in this question.
Note that sessions are not permanent by default, and need to be activated with session.permanent = True, as described in this answer.
Solution 2:
solution of your problem and for that you have to import datetime.timedelta library
session.permanent = True
app.permanent_session_lifetime = timedelta(seconds=3)
session.modified = True
Post a Comment for "Flask Logout If Sessions Expires If No Activity And Redirect For Login Page"