Welcome to Streamlit Cookie Controller 🍪
Control client browser cookie for the site.
What is Streamlit Cookie Controller?
streamlit-cookies-controller let you
- get cookie(s)
- set cookie
- remove cookie
from/to the client browser. It use universal-cookie package to access the cookies.
Installation
Open a terminal and run:
pip install streamlit-cookies-controller
Quickstart
Create a new file example.py
import streamlit as st
from streamlit_cookies_controller import CookieController
st.set_page_config('Cookie QuickStart', '🍪', layout='wide')
controller = CookieController()
# Set a cookie
controller.set('cookie_name', 'testing')
st.write(st.session_state)
# Get all cookies
cookies = controller.getAll()
st.write(cookies)
# Get a cookie
cookie = controller.get('cookie_name')
st.write(cookie)
# Remove a cookie
controller.remove('cookie_name')
st.write(st.session_state)
Run the streamlit app
streamlit run example.py
Change Log
Version 0.0.1
- Initial release
Version 0.0.2
- return None when there is no cookie with the given name instead of throw error
Version 0.0.3
Remove Test1 in frontend due to it is flikkering on streamlit v1.32.0
Metadata
Release files for streamlit-cookies-controller 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| streamlit-cookies-controller-0.0.4.tar.gz | 406.3 kB | Without provenance | Details for streamlit-cookies-controller-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| streamlit_cookies_controller-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for streamlit_cookies_controller-0.0.4-py3-none-any.whl |
Total release size: 815.6 kB
Security for streamlit-cookies-controller 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.