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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68746eff718a3ed1deceeb3990560f082812b6e3353a7d6411be45c5b7246df2 |
|
MD5 | 5ef1fec2cd1c8f3d740bc159179e16ce |
|
BLAKE2b-256 | 0921b917c7c3dcff5d518a2dc41c465ebcd9414c41ce17816933dfb4a9879d2f |
Close
Hashes for streamlit_cookies_manager-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d51d586c6db52f4a50e309d691906ec95927c58699e0e55bb887bbb9b21711f |
|
MD5 | 750ecc2c9c331b16bb46e964681fb2e6 |
|
BLAKE2b-256 | 877eb95ca6b46cae02b50fe2bbe660e9cba1c2375da7e3b89f2385722a8157dd |