Flask-login maintenance login problem

flask-login "s login status before trying to log in is False,
. After login, the output login status is True,
, but then when you jump to the web page, the login status automatically changes to False?
. It"s a problem that no one else seems to have encountered on the Internet.
console.
ps:

if not user.verify_password(password)

, .
,
, redirect(next_page or url_for("index")).

, .

models, , .


I think the problem of the landlord may lie in user model's get_id method

-sharp get_id 
-sharp get_id()
-sharp  user_loader   unicode 
-sharp    unicode  ID   int 
-sharp  unicode 
-sharp :user_loader
-sharp get_iduser
-sharp 
-sharp 
return uuid.uuid4()

-sharp :
-sharp 1. 
return '1'
-sharp 2. 
return str(self.id)

add (because you haven't used this plug-in, please ignore it if it's wrong. ):

-sharp 
-sharp  login_require 
-sharp 
-sharp 

-sharp 1. flask-login
@login_manager.user_loader
def load_user(user_id):
    return User.get(user_id)

-sharp 2. load_useruser_id
def get_id(self):
    -sharp 
    -sharp user
    return str(self.id)
Menu