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”:{}
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.
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
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”]
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?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.