Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

st-cookie

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

st-cookie

Streamlit Cookie Writer and Reader

  • 0.2.3
  • PyPI
  • Socket score

Maintainers
1

What

st_cookie is a Python package that allows you to store and retrieve data in a cookie.

Installation

pip install st-cookie

Usage

  • import
from st_cookie import cookie_manager
  • Usage 1
    Use cookie_manager.load_to_session_state() to load all the variables from cookies to session state. Use cookie_manager.update() to update session states to cookies with on_change or on_click callback of streamlit components.
cookie_manager.load_to_session_state()

st.checkbox(
    "enabled",
    key="my_checkbox",
    on_change=lambda: cookie_manager.update("my_checkbox"),
)
  • Usage 2
    Use context manager cookie_manager.sync() to sync variables to between cookies and session states.
with cookie_manager.sync("my_textinput", "my_number"):
    st.text_input("Enter text", key="my_textinput")
    st.number_input("Enter number", key="my_number")

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc