mkhorasani / Streamlit-Authenticator

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

Cookies not working in cloud deployments / docker #197

Open brdemorin opened 3 months ago

brdemorin commented 3 months ago

Mohammed, I swear, last one. This is the most important one of all -> Cookies work fine locally until deploying to streamlit community cloud or any cloud via docker. When I test docker locally, no cookie data retained

Earlier versions I created yesterday were setting/getting cookie in cloud deployments. So I went back revisions to see where it broke and why. However, NONE of those earlier versions retain cookie info in cloud deployments anymore.

mkhorasani commented 3 months ago

Hi @brdemorin, yes unfortunately I am aware of problems with cookies being implemented on cloud servers. Streamlit is in the process of implementing its own native cookies feature, and I will be gradually rolling it out in the hopes of solving these problems once and for all!

LeeOSO commented 2 months ago

I encountered the same issue where everything worked as expected during local testing, with cookies being written correctly and login status being maintained properly. However, when the project was deployed to the server, I noticed that cookies would sometimes be written and sometimes not. When cookies were not written, the login status could not be maintained. Could you please advise on how to resolve this issue? @mkhorasani

mkhorasani commented 2 months ago

I encountered the same issue where everything worked as expected during local testing, with cookies being written correctly and login status being maintained properly. However, when the project was deployed to the server, I noticed that cookies would sometimes be written and sometimes not. When cookies were not written, the login status could not be maintained. Could you please advise on how to resolve this issue? @mkhorasani

Hi @LeeOSO, currently, I am using a third party package to read/write cookies, as soon as Streamlit updates st.context to include writing cookies, I will update Streamlit-Authenticator in the hopes that this problem can be solved once and for all. Thank you for your patience.