streamlit-cookies-controller API Reference

Full documentation for streamlit-cookies-controller (Standard Library / Native)

streamlit-cookies-controller.CookieController
Python Library Documentation: class CookieController in module streamlit_cookies_controller.cookie_controller

class CookieController(builtins.object)
 |  CookieController(key: str = 'cookies')
 |
 |  Hook cookies get/set on Express for server-rendering
 |
 |  Methods defined here:
 |
 |  __init__(self, key: str = 'cookies')
 |      Initialize cookie controller
 |
 |      ### Arguments
 |      key: str
 |          the session state key name to store the cookies
 |
 |  get(self, name: str)
 |      Gets a cookie with the name
 |
 |      ### Arguments
 |      name: str
 |          Name of the cookie
 |
 |      ### Returns
 |          The value of the cookie with the given name
 |
 |  getAll(self)
 |      Get all cookie for the domain
 |
 |      ### Returns : dict[str, any]
 |      All client cookie for the site in dictionary
 |
 |  refresh(self)
 |      Refresh the cookie cache located in streamlit session state with the actual browser cache
 |
 |  remove(self, name: str, path: str = '/', domain: Optional[str] = None, secure: Optional[bool] = None, same_site: Union[bool, NoneType, Literal['lax', 'strict']] = 'strict', partitioned: Optional[bool] = None)
 |      Remove the cookie with the given name
 |
 |      ### Arguments
 |      name: str
 |          Name of the cookie
 |      path: str
 |          Cookie path, use '/' as the path if you want your cookie to be accessible on all pages
 |      domain: str | None
 |          Domain for the cookie (sub.domain.com or .allsubdomains.com)
 |      secure: bool | None
 |          Is only accessible through HTTPS?
 |      sameSite: bool | None | 'strict' | 'lax'
 |          Strict or Lax enforcement
 |      partitioned: bool
 |          Indicates that the cookie should be stored using partitioned storage
 |
 |  set(self, name: str, value: Any, path: str = '/', expires: Optional[datetime.datetime] = None, max_age: Optional[float] = None, domain: Optional[str] = None, secure: Optional[bool] = None, same_site: Union[bool, NoneType, Literal['lax', 'strict']] = 'strict', partitioned: Optional[bool] = None)
 |      Sets given `value` to cookie with given name
 |
 |      ### Arguments
 |      name: str
 |          Name of the cookie
 |      value: any
 |          Value of the cookie
 |      path: str
 |          Cookie path, use '/' as the path if you want your cookie to be accessible on all pages
 |      expires: datetime | None
 |          Absolute expiration date for the cookie. If `None` or default, it will be a day from now.
 |      max_age: float | None
 |          Relative maximum age of the cookie from the client receives it in seconds.
 |      domain: str | None
 |          Domain for the cookie (sub.domain.com or .allsubdomains.com)
 |      secure: bool | None
 |          Is only accessible through HTTPS?
 |      sameSite: bool | None | 'strict' | 'lax'
 |          Strict or Lax enforcement
 |      partitioned: bool
 |          Indicates that the cookie should be stored using partitioned storage
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables
 |
 |  __weakref__
 |      list of weak references to the object
 |
 |  ----------------------------------------------------------------------
 |  Data and other attributes defined here:
 |
 |  __annotations__ = {'_CookieController__cookies': typing.Dict[str, typi...
streamlit-cookies-controller.RemoveEmptyElementContainer
Python Library Documentation: function RemoveEmptyElementContainer in module streamlit_cookies_controller.utils

RemoveEmptyElementContainer()
streamlit-cookies-controller.utils
Python Library Documentation: module streamlit_cookies_controller.utils in streamlit_cookies_controller

NAME
    streamlit_cookies_controller.utils

DESCRIPTION
    # Author    : Nathan Chen
    # Date      : 08-Mar-2024

FUNCTIONS
    RemoveEmptyElementContainer()

FILE
    c:\users\youse\appdata\local\programs\python\python312\lib\site-packages\streamlit_cookies_controller\utils.py