Mohamed-512 / Extra-Streamlit-Components

An all in one place, to find complex or just not available components by default on streamlit.
Apache License 2.0
466 stars 59 forks source link

There are multiple identical `st.extra_streamlit_components.CookieManager.cookie_manager` widgets with `key='set'`. #28

Closed Anti-Apple4life closed 2 years ago

Anti-Apple4life commented 2 years ago

I have gotten this error when trying to access the cookie that I set, and when I set it as well. Below is the code referenced in the error:

cookie_manager.set("Username", username)

def checkifcookieexists(cookie_name):
    cookie_manager = get_manager()
    cookie = cookie_manager.get(cookie=cookie_name)

In one file

@st.cache(allow_output_mutation=True)
def get_manager():
    return stx.CookieManager(random.choice(string.ascii_letters))

In another file

@st.cache(allow_output_mutation=True)
def get_manager():
    return stx.CookieManager(random.choice(string.ascii_letters))
Mohamed-512 commented 2 years ago

What is the error you are facing?

Anti-Apple4life commented 2 years ago

It is resolved, I am writing this on my phone and will close it later

OptimeeringBigya commented 2 years ago

I am having the same issue. How did you fix the issue?