I’m having a similar experience as many other users reporting here. I too experience the 3x loading as described and inconsistent return of cookies despite trying different ways of trying to get around that.
It’s effectively unusable for me.
Note I have found more luck with streamlit-cookies-manager · PyPI
But this library does not work on safari (macOS or iOS) in my testing. There are some issues with it sometimes initially loading as well.
This is a good method. Unfortunately, it can only query the current session ID. Once I change the cookie, it still returns the previous value. Thank you
Is there a plan to support Streamlit’s new cache functions? st.cache was deprecated, and neither st.cache_data nor st.cache_resource seem to work with this package.
Thanks!
Updated minimum version of Streamlit required by ExtraStreamlitComponents to replace deprecated methods with newer ones, add more control over CookieManager, and fix known bugs. Please upgrade your package to 0.1.60
Hello, I would like to mention another issue with this package. I have an application with a login page and 13 other pages. Hence, each page gets cookies from the browser to check login activity and shows the content or displays an error accordingly. However, I realized after I deployed the website that the CPU usage of the website increased significantly after some time from the deployment, which caused an extreme slowdown. When I redeployed the website, the response time was perfect. However, it slowed down after some time, again. Then, I used memory-profiler to check what was causing this slowdown. The outcome is that this package causes an extreme slowdown in the website. It is so slow that the login page does not show up anymore. How can I solve this problem?
Did you tried to save the status of logged user in st.session_state, and then just calling it in every page? Maybe the calling cookies each page is getting the app slower?
Just thinking around this issue.
I am using the cookies manager with following code. my code works in local environment, but i need to deploy my application in a docker container, and surprisingly application is not able to store cookies there, and not even throwing any error.
Could you please help me out.
Thank you.
import extra_streamlit_components as stx
from datetime import datetime, timedelta
import streamlit as st
cookie_manager = stx.CookieManager()
def set_cookie():
cookie_manager.set("my-cookie", "token-value",
expires_at=datetime.now() + timedelta(minutes=5))
def delete_cookie():
cookie_manager.delete("my-cookie")
st.button("Set cookie", on_click=set_cookie)
st.button("Delete cookie", on_click=delete_cookie)
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.