# Streamlit Cookies Manager Extended
Extended version of Streamlit Cookies Manager. Support latest python and streamlit versions.
Access and change browser cookies from Streamlit scripts:
```python
import os
import streamlit as st
from streamlit_cookies_manager_ext 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="streamlit-cookies-manager-ext/",
# 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
```
Raw data
{
"_id": null,
"home_page": null,
"name": "streamlit-cookies-manager-ext",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": null,
"author": "Tomasz Kontusz",
"author_email": "tomasz.kontusz@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/02/37/a521b1e4c8bd562d724b3bc181fc58c1058f3d8d94d9721dd6f64d9f80bf/streamlit_cookies_manager_ext-0.1.0.tar.gz",
"platform": null,
"description": "# Streamlit Cookies Manager Extended\n\nExtended version of Streamlit Cookies Manager. Support latest python and streamlit versions.\n\nAccess and change browser cookies from Streamlit scripts:\n\n```python\nimport os\nimport streamlit as st\nfrom streamlit_cookies_manager_ext import EncryptedCookieManager\n\n# This should be on top of your script\ncookies = EncryptedCookieManager(\n # This prefix will get added to all your cookie names.\n # This way you can run your app on Streamlit Cloud without cookie name clashes with other apps.\n prefix=\"streamlit-cookies-manager-ext/\",\n # You should really setup a long COOKIES_PASSWORD secret if you're running on Streamlit Cloud.\n password=os.environ.get(\"COOKIES_PASSWORD\", \"My secret password\"),\n)\nif not cookies.ready():\n # Wait for the component to load and send us current cookies.\n st.stop()\n\nst.write(\"Current cookies:\", cookies)\nvalue = st.text_input(\"New value for a cookie\")\nif st.button(\"Change the cookie\"):\n cookies['a-cookie'] = value # This will get saved on next rerun\n if st.button(\"No really, change it now\"):\n cookies.save() # Force saving the cookies now, without a rerun\n```\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Access and save cookies from Streamlit",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "68716378450dc12bfe5a0eb8defb4ab45423cd01e35aea0bb1fc3f4186a50247",
"md5": "e1402e910cbe9fe4b23e8f464eea611f",
"sha256": "5fb319531344dcd0bb1668d876fdcadadf27dd96d8958c7c71a5520a890c23bc"
},
"downloads": -1,
"filename": "streamlit_cookies_manager_ext-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e1402e910cbe9fe4b23e8f464eea611f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 70565290,
"upload_time": "2025-02-16T11:53:52",
"upload_time_iso_8601": "2025-02-16T11:53:52.221639Z",
"url": "https://files.pythonhosted.org/packages/68/71/6378450dc12bfe5a0eb8defb4ab45423cd01e35aea0bb1fc3f4186a50247/streamlit_cookies_manager_ext-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0237a521b1e4c8bd562d724b3bc181fc58c1058f3d8d94d9721dd6f64d9f80bf",
"md5": "72a67de9fdb97f372812284c84490697",
"sha256": "71262531d2bb4e42529efe176660b775a042aa176cc00884d5927d368953d8ec"
},
"downloads": -1,
"filename": "streamlit_cookies_manager_ext-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "72a67de9fdb97f372812284c84490697",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 52048242,
"upload_time": "2025-02-16T11:54:56",
"upload_time_iso_8601": "2025-02-16T11:54:56.645352Z",
"url": "https://files.pythonhosted.org/packages/02/37/a521b1e4c8bd562d724b3bc181fc58c1058f3d8d94d9721dd6f64d9f80bf/streamlit_cookies_manager_ext-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-16 11:54:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "streamlit-cookies-manager-ext"
}