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

CookieManager.set(expires_at=) default value issue #24

Closed yenpinchiu closed 2 years ago

yenpinchiu commented 2 years ago

Hi, thanks for your nice Streamlit add-ons. When I use the cookie manager component, I find an issue.

https://github.com/Mohamed-512/Extra-Streamlit-Components/blob/596d088a30806a5273a0ae97b11de08a3e26c683/extra_streamlit_components/CookieManager/__init__.py#L24

Based on the Python behavior, the default value of expires_at will always be the Steamlit app started time but not the function called time, which means one day after the Steamlit app started, I won't be able to set the cookie without giving the expires_at because the default expires_at time will be earlier than the current time.

I'm not sure it's an intentionally designed mechanism or a bug. Thank you.

Mohamed-512 commented 2 years ago

It's a bug, great catch! You can update to version 0.1.55 for the fix.