mkhorasani / Streamlit-Authenticator

A secure authentication module to manage user access in a Streamlit application.
Other
1.56k stars 248 forks source link

Does the session parameters remain as is even after reloading the page? #16

Closed aadarshsingh191198 closed 2 years ago

aadarshsingh191198 commented 2 years ago

I tried implementing a login myself. It uses the session variables to do the authentication just like you mentioned in your medium blog. But on reloading the page, the session variables go away, and thus the user is logged out. So, have you handled that in this library?

mkhorasani commented 2 years ago

Yes that is correct, when you reload the page a new Streamlit session is created and all session state variables from the previous session are reset (including the login state), that is why this library is using cookies to store authentication parameters persistently on the client's browser. As long as you set the cookie_expiry_days > 0, then you should face no problems with automatic reauthentication.