Skip to main content

Streamlit Cookies Manager

Access and change browser cookies from Streamlit scripts:

import os
import streamlit as st
from streamlit_cookies_manager import EncryptedCookieManager

# This should be on top of your script
cookies = EncryptedCookieManager(
    # This prefix will get added to all your cookie names.
    # This way you can run your app on Streamlit Cloud without cookie name clashes with other apps.
    prefix="ktosiek/streamlit-cookies-manager/",
    # You should really setup a long COOKIES_PASSWORD secret if you're running on Streamlit Cloud.
    password=os.environ.get("COOKIES_PASSWORD", "My secret password"),
)
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

Metadata

Release files for streamlit-cookies-manager-hotpatched 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-cookies-manager-hotpatched 0.2.1
File Size Uploaded
streamlit_cookies_manager_hotpatched-0.2.1.tar.gz 676.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-cookies-manager-hotpatched 0.2.1
File Interpreter ABI Platform
streamlit_cookies_manager_hotpatched-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.4 MB

Release files / streamlit_cookies_manager_hotpatched-0.2.1.tar.gz

Download URL streamlit_cookies_manager_hotpatched-0.2.1.tar.gz
Size 676.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0af09d8c6fbb81d292c3b200d04b3f06e9c7339f282adbe6e84f3b036ddabb50
BLAKE2b-256 checksum
How to use checksums
58f1e8720c442b7edd11e1f46aeff599a2415d335536ece5c3db7a373f8a7871
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / streamlit_cookies_manager_hotpatched-0.2.1-py3-none-any.whl

Download URL streamlit_cookies_manager_hotpatched-0.2.1-py3-none-any.whl
Size 688.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a354206ece0a7b93a24d62c16109d636f407506ba5eecdde759307da18aeb47
BLAKE2b-256 checksum
How to use checksums
27f723b612f86e8a1bd2106339e3375e44c798b0f5636ef2eba21c7078a35623
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page