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.6.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.6-py3-none-any.whl
(690.9 kB
view details)
File details
Details for the file ace_cm-0.0.6.tar.gz.
File metadata
- Download URL: ace_cm-0.0.6.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 |
2184c835ee1f15310c4bf00b3286bc6cb0fc052306ce82ba0912a217bf542482
|
|
| MD5 |
d37088b08915f7ab293849ffc7be31a5
|
|
| BLAKE2b-256 |
9bcbd2a0af7c25d5271322d7ed2a9bb143dbbaa94e68381c137c173071907532
|
File details
Details for the file ace_cm-0.0.6-py3-none-any.whl.
File metadata
- Download URL: ace_cm-0.0.6-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 |
80c573d5c2769d736ff2a324ef67292429de2faa952c9f04485912b1ac450ca6
|
|
| MD5 |
79a8f3778c15f5dcc13cf08439085ae7
|
|
| BLAKE2b-256 |
763a20adafd5ab2139e1d00580183ec89cb63e2e73fa21ee52b2e63302c54a13
|