Closed fcolecumberri closed 6 months ago
I think you'll stumble into other issues using that approach.
I'm not sure if something changed with Streamlit execution model since this component was originally developed, but currently there are issues related with reruns and cookies not being returned deterministically without some hacking...
How can you avoid the infinite reload issue with cookies? It seems like sometimes - even on 2GB + servers. - the page reloads almost indefinitely for cookies.
This looks related to the issue I just made: https://github.com/Mohamed-512/Extra-Streamlit-Components/issues/58
Should be fixed in 0.1.70
I am Using
extra-streamlit-components==0.1.56
. I have noticed that when instantiated, CookieManager takes some time after the constructor returned to read the cookies and if the cookies are attempted to be read, the calls will successfully return like if no cookies were there.A way I have done to mitigate the problem is the next code:
However polling is not ideal. Also this only works because the
_xsrf
token is always generated by streamlit regardless of the necessity so I know I will never be stuck in the loop.