mkhorasani / Streamlit-Authenticator

A secure authentication module to validate user credentials in a Streamlit application.
Apache License 2.0
1.38k stars 229 forks source link

Logging users #31

Closed lgidon closed 1 year ago

lgidon commented 1 year ago

I'm looking for a way to track the users login by writing a new line to a db table on each successful login. Triggering the write after if authentication_status: will trigger everytime the app gets rerun, not just on login.

Is there a way to get just the "original" login?

mkhorasani commented 1 year ago

Hi @lgidon you can use the cookie manager in the package extra_streamlit_components to read the authentication cookie. That cookie includes the cookie expiry date which you can use to determine when the user originally logged in.