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

How to set multiple cookies #59

Closed tunglambk closed 6 months ago

tunglambk commented 7 months ago

I encountered a streamlit.errors.DuplicateWidgetID error, which seems to arise when attempting to set multiple cookies using the cookie manager. The error message indicates that there are multiple widgets with the same 'key' set.

The error occurs in the following block of code:

st.session_state['cookie_manager'].set('user_token', access_token, expires_at=expires_at)
st.session_state['cookie_manager'].set('refesh_token', refresh_token, expires_at=expires_at)

image

Is there any way to set multiple cookies like this?

Thank you

karunpoudel-chr commented 7 months ago

You can provide different key parameter for those individual call.

Mohamed-512 commented 6 months ago

@karunpoudel-chr suggestion is valid. If folks want a batch add method, then emote 👍 on this comment.

Mohamed-512 commented 6 months ago

I have added a batch add method to the cookie manager. Please upgrade to 0.1.70+

miukki commented 4 months ago

where is documentation about batch add method

miukki commented 4 months ago

hi @Mohamed-512