Skip to main content

Access and save cookies from Streamlit for 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.5.tar.gz (679.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ace_cm-0.0.5-py3-none-any.whl (690.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ace_cm-0.0.5.tar.gz
  • Upload date:
  • Size: 679.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for ace_cm-0.0.5.tar.gz
Algorithm Hash digest
SHA256 fa557b2ff75224e5d3102da4682b33eb759e2875ba45a8d1ffbc2447fe701139
MD5 85652bc1fbffa5bf3ccb379da207fb06
BLAKE2b-256 d7a862ed03012522dc6d41bcd8aea12ca1778e91e9dffcfbb3ca8e62db7b3241

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ace_cm-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 690.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for ace_cm-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 713c8ed81f6622f57f0df82c8994e9b74ffa5cc4cd06d675e9e5eaeb95e7bd8f
MD5 6fba09a81cb8209a0082727223fd4366
BLAKE2b-256 ad44d43ed8b05538343c86df2bae6054cba0a4588b6a4b487a78425aaade0346

See more details on using hashes here.

Supported by

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