If I try to set a cookie using a newly created CookieManager, I get errors saying st.session.state.cookies is None. Minimal example:
import time
import extra_streamlit_components as stx
SLEEP_TIME = 1
cookie_manager = stx.CookieManager()
time.sleep(SLEEP_TIME)
cookie_manager.set('yummy_cookie', "nomnom")
If SLEEP_TIME is too low I get the error
File "/home/colin/anaconda3/envs/cookiestest/lib/python3.7/site-packages/streamlit-1.0.0-py3.7.egg/streamlit/script_runner.py", line 354, in _run_script
exec(code, module.__dict__)
File "/home/colin/Documents/minut/py-owl/test_cookies.py", line 8, in <module>
cookie_manager.set('yummy_cookie', "nomnom")
File "/home/colin/anaconda3/envs/cookiestest/lib/python3.7/site-packages/extra_streamlit_components/CookieManager/__init__.py", line 63, in set
st.session_state.cookies.update({cookie: val})
AttributeError: 'NoneType' object has no attribute 'update'
If I try to set a cookie using a newly created CookieManager, I get errors saying
st.session.state.cookies
isNone
. Minimal example:If
SLEEP_TIME
is too low I get the error