Skip to main content

Access and save cookies from Streamlit

Project description

ACE Cookie Manager

Access and change browser cookies from Streamlit scripts:

import os
import streamlit as st
from ace_cm import ECM

# This should be on top of your script
cookies = ECM(
    prefix="ace/ace-cm/",
    password=os.environ.get("COOKIES_PASSWORD", "My secret password"),
)
if not cookies.ready():
    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

ace_cm-0.0.4.tar.gz (679.3 kB view details)

Uploaded Source

Built Distribution

ace_cm-0.0.4-py3-none-any.whl (689.9 kB view details)

Uploaded Python 3

File details

Details for the file ace_cm-0.0.4.tar.gz.

File metadata

  • Download URL: ace_cm-0.0.4.tar.gz
  • Upload date:
  • Size: 679.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.3 Darwin/24.0.0

File hashes

Hashes for ace_cm-0.0.4.tar.gz
Algorithm Hash digest
SHA256 67f0e7791afb38be285abc78f3162c5aac6e3f83f5be222b67448f19c4db7697
MD5 411e9a8e85fe5ed072763033d60f3584
BLAKE2b-256 0438515cfa0317b0ead9d97e36ce2df0314f269521b4db889f64c3dcc256b1d2

See more details on using hashes here.

File details

Details for the file ace_cm-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: ace_cm-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 689.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.3 Darwin/24.0.0

File hashes

Hashes for ace_cm-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bb50124a962e98adb50e3b231aa12e1264f316ea77203178302da11675fa3451
MD5 c5dab2def0b29b23201bc3c31c85bb25
BLAKE2b-256 2fc1bb29b71d2fd3469663b0bad5c901842496a43a9d0719de34e0027e31bdee

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