Access and save cookies from Streamlit
Project description
Streamlit Cookies Manager
Access and change browser cookies from Streamlit scripts:
import streamlit as st
from streamlit_cookies_manager import CookieManager
# This should be on top of your script
cookies = CookieManager()
if not cookies.ready():
# Wait for the component to load and send us current cookies.
st.stop()
st.write("Current cookies:", cookies)
value = st.text_input("New value for a cookie")
if st.button("Change the cookie"):
cookies['a-cookie'] = value # This will get saved on next rerun
if st.button("No really, change it now"):
cookies.save() # Force saving the cookies now, without a rerun
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for streamlit-cookies-manager-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632dd0eb5aa1a4e5348f5f32bec4a2a8cc135c434b0d3078cd036d3d440106d6 |
|
MD5 | a599d7bd8ddea7e6be571fe1474da1ce |
|
BLAKE2b-256 | 420341fbba71be26c299d14cc49fdbdcb8ab625c29a09f8705aa61390aa36cd6 |
Close
Hashes for streamlit_cookies_manager-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8b2d3fb03207b6569366a87cabe9febabacda7e5bc48577339e8ebe52749b90 |
|
MD5 | 506f81696130163f7ee58f34c9b65946 |
|
BLAKE2b-256 | 1c2546f56d2aff9416fa632e13c0553fc55e5ccc1dedf9a1b9bd51f4853bd31c |