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.1.tar.gz (678.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: streamlit-cookies-manager-0.1.1.tar.gz
  • Upload date:
  • Size: 678.6 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.1.tar.gz
Algorithm Hash digest
SHA256 68746eff718a3ed1deceeb3990560f082812b6e3353a7d6411be45c5b7246df2
MD5 5ef1fec2cd1c8f3d740bc159179e16ce
BLAKE2b-256 0921b917c7c3dcff5d518a2dc41c465ebcd9414c41ce17816933dfb4a9879d2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for streamlit_cookies_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1d51d586c6db52f4a50e309d691906ec95927c58699e0e55bb887bbb9b21711f
MD5 750ecc2c9c331b16bb46e964681fb2e6
BLAKE2b-256 877eb95ca6b46cae02b50fe2bbe660e9cba1c2375da7e3b89f2385722a8157dd

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