Skip to main content

Welcome to Streamlit Cookie Controller 🍪

PyPI Download GitHub GitHub license GitHub issues GitHub pull requests

Control client browser cookie for the site.

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)

Source distribution for streamlit-cookies-controller 0.0.4
File Size Uploaded
streamlit-cookies-controller-0.0.4.tar.gz 406.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-cookies-controller 0.0.4
File Interpreter ABI Platform
streamlit_cookies_controller-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 815.6 kB

Release files / streamlit-cookies-controller-0.0.4.tar.gz

Download URL streamlit-cookies-controller-0.0.4.tar.gz
Size 406.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f5df2543de858f1585dcb6e90f58f38aafbf313ee8e237c64663b2d9761583cc
BLAKE2b-256 checksum
How to use checksums
b0c87caf505d62faeb8c0f6e6b74b554e1c2b0c3ca46c0a39250445c574a5a18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release files / streamlit_cookies_controller-0.0.4-py3-none-any.whl

Download URL streamlit_cookies_controller-0.0.4-py3-none-any.whl
Size 409.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f97fec6acdeee9cb9e16da25c3fc91d404b5b0ddced87c1d9fa9c62f65ca3251
BLAKE2b-256 checksum
How to use checksums
02c63bbdfecf5009943bcb62d37e3fd4b3fe45e87137e449a50e3025170bc9f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page