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.7.tar.gz
(679.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ace_cm-0.0.7-py3-none-any.whl
(690.9 kB
view details)
File details
Details for the file ace_cm-0.0.7.tar.gz.
File metadata
- Download URL: ace_cm-0.0.7.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1df86c88ffb47f6f411d3d308aebbfc74855618b6694fadcab59842adf31a0d
|
|
| MD5 |
11e8328e54580db100cb596dfc510aab
|
|
| BLAKE2b-256 |
d074d2e90786253b6bdfa9a90dddfee84bc1a1724520e8dae768a082a0cea75c
|
File details
Details for the file ace_cm-0.0.7-py3-none-any.whl.
File metadata
- Download URL: ace_cm-0.0.7-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c6c94d3c9652f16061120945e32f350f71fe95bc3fcb86ce9bfd6d9136f6c40
|
|
| MD5 |
4c93b2da36ae1487679f30787f34ca00
|
|
| BLAKE2b-256 |
da3ae8982f83a74c44e0d43668ebc65ea84aa972f505692a5fba449a87ed511e
|