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()
controller.set('cookie_name', 'testing')
st.write(st.session_state)
cookies = controller.getAll()
st.write(cookies)
cookie = controller.get('cookie_name')
st.write(cookie)
controller.remove('cookie_name')
st.write(st.session_state)
Run the streamlit app
streamlit run example.py
Change Log
Version 0.0.1
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