After installing streamlit_authenticator and logging in, sidebar menu desappears when reloading browser, other components remain

Hello!

I installed Streamlit-Authenticator and everything works as intended. However, when I reload the browser, the streamlit-option-menu on my sidebar disappears. It seems to only affect the streamlit-option-menu component, since other components do appear as expected (I will include a screen caption below to show behavior). In search of finding clues, I compared the session state before and after refreshing the browser and the only changes I saw are:

Before refresh:
“logout_key”:false
“logout”:true
“failed_login_attempts”:{
“jmm”:0
}

After refresh:
“logout”:NULL
“FormSubmitter:Register user-Register”:false
“failed_login_attempts”:{}

Has anyone experienced this type of issue?

Before Refreshing:

After Refreshing:
image

Streamlit: 1.32.2
Python version: 3.12.0
Running locally
Windows 10 Enterprise

I have not had a reply yet, not sure if I am the only one experiencing this problem… perhaps it’s somewhat of an obscure issue, yet, I have tried pretty much everything to get this to work with no success. Any suggestions are welcomed.

I have similar problem like you
If you know the reason , notice me thank you

1 Like

Hi @dongbang_ban, I’m not sure if this issue is related to Streamlit-Authenticator.

Would you know if my issue is in fact related to the Authenticator or do you think is something else affecting the menu?

I’ll let you know if I can resolve this problem… does not look that promising for now…

Not sure whether it is a problem with streamlit or streamlit_authenticator. I updated streamlit_authenticator to the latest version and the same problem occurred after updating streamlit to version 1.32.2. The Streamlit-antd-components sidebar I used cannot be displayed. The problem was solved after downgrading streamlit to 1.32

1 Like

I resolved!!! Thank you!

How did you resolve it?

I couldn´t. I have decided to try using Firebase Authentication instead. I´ll let you know how it goes…

Hello, I have successfully resolved the issue by downgrading Streamlit to version 1.32, as suggested by S_yai:

pip install streamlit==1.32

downgrading to 1.32 solved it for me as well, however, we are losing quite a few new features that were added later, e.g. on_select is not available in 1.32

I tried the new version, it works perfectly when running alone, but Streamlit-antd-components is also very normal, when I use the streamlit_authenticator the same problem happens, when you log in/refresh the web page, the components can’t be displayed, you can manually press R to make the page display; I guess that’s the streamlit_authenticator problem, I filed an issue with the author, it seems that the author hasn’t found the reason yet, and I hope anyone else is inspired to help on github

After testing, it was found that the problem was caused by extra_streamlit_components component. If you are also using Streamlit-Authenticator and streamlit==1.37, you can use the following code to fix it
Modify Streamlit_Authenticator/models/cookie_model.py
Comment: # self.token = self.cookie_manager.get(self.cookie_name)
Modified to (streamlit==1.37)
if st.context.cookies.get(“stauth_cookie”):
self.token = st.context.cookies[“stauth_cookie”]

Thank you!!!

For the application I was working on, I ended up using Firebase authenticator. I may try this again on the next project.

I tried this with streamlit==1.37.1 and streamlit-authenticator==0.3.3, and now every time I reload the page, I get logged out. Is that the expected behaviour?