Answer the question
In order to leave comments, you need to log in
Authentication in Flask python?
Hello, I have such a question, I use flask python, When you log in, you must enter the profile. If I logged in later, then the server restarted, it does not remember that I already logged in. You need to re-enter your username and password. How to make him remember?
Answer the question
In order to leave comments, you need to log in
If you use flask-login (flask-security seems to do this automatically), then there is a setting session.permanent = True
It should be used in app.before_request
Well, you can add a sign to the user whether to remember him on the site.
I have so:
@app.before_request
def make_session_permanent():
g.user = current_user
if g.user.store_me:
session.permanent = True
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question