I've written a login.views.py
for LDAP3 authentication, and the application is such that once the user login successfully, it will take the user to a template with Welcome "username" displayed on the top right of all future request pages. My application configuration for this login module is __init__.py
. Part of the template code regarding whether the user is authenticated is here.
All of the above codes persist user's name in all future requests (that is different modules of the application) once logged in using Flask's development server; however, when I deployed the application live to production server (nginx, uwsgi), the username is sometimes persisted and other time not persisted.
I've followed two previous similar questions on StackOverflow: first question and second question, but still can't understand to solve my problem.
How do I persist users' info for all future requests once they successfully login?