Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit-cookies-manager-0.1.0.tar.gz (678.5 kB view details)

Uploaded Source

Built Distribution

streamlit_cookies_manager-0.1.0-py3-none-any.whl (689.1 kB view details)

Uploaded Python 3

File details

Details for the file streamlit-cookies-manager-0.1.0.tar.gz.

File metadata

  • Download URL: streamlit-cookies-manager-0.1.0.tar.gz
  • Upload date:
  • Size: 678.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.7 Linux/5.13.0-23-generic

File hashes

Hashes for streamlit-cookies-manager-0.1.0.tar.gz
Algorithm Hash digest
SHA256 632dd0eb5aa1a4e5348f5f32bec4a2a8cc135c434b0d3078cd036d3d440106d6
MD5 a599d7bd8ddea7e6be571fe1474da1ce
BLAKE2b-256 420341fbba71be26c299d14cc49fdbdcb8ab625c29a09f8705aa61390aa36cd6

See more details on using hashes here.

File details

Details for the file streamlit_cookies_manager-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_cookies_manager-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8b2d3fb03207b6569366a87cabe9febabacda7e5bc48577339e8ebe52749b90
MD5 506f81696130163f7ee58f34c9b65946
BLAKE2b-256 1c2546f56d2aff9416fa632e13c0553fc55e5ccc1dedf9a1b9bd51f4853bd31c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page