Package 'glouton'

Title: 'JS-cookies' for 'Shiny'
Description: Set and get browser cookies in 'Shiny' through 'JS-cookie'.
Authors: Colin Fay [cre, aut] , Klaus Hartl [ctb, cph] (Author of JS-Cookies)
Maintainer: Colin Fay <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2024-12-03 04:57:04 UTC
Source: https://github.com/ColinFay/glouton

Help Index


Add and fetch browsers cookies

Description

fetch_cookies returns all the cookies, while fetch_cookie search for one cookie in the browser.

Usage

fetch_cookies(session = shiny::getDefaultReactiveDomain())

fetch_cookie(name, session = shiny::getDefaultReactiveDomain())

add_cookie(
  name,
  value,
  options = cookie_options(),
  debug = FALSE,
  session = shiny::getDefaultReactiveDomain()
)

remove_cookie(
  name,
  options = cookie_options(),
  session = shiny::getDefaultReactiveDomain()
)

cookie_options(
  expires = NULL,
  path = "/",
  domain = NULL,
  secure = FALSE,
  sameSite = "strict"
)

Arguments

session

The session object passed to function given to shinyServer. Default is shiny::getDefaultReactiveDomain()

name

Name of the cookie to set/fetch

value

The value to set for the cookie

options

A list of options returned from cookie_options(). The same options that were passed to add_cookie() must be passed to remove_cookie().

debug

If TRUE, a message is displayed in the browser console after adding a cookie.

expires

Define when the cookie will be removed. Value must be a numeric, which will be interpreted as days from time of creation or a date. If NULL, the cookie becomes a session cookie.

path

A string indicating the path where the cookie is visible.

domain

A string indicating a valid domain where the cookie should be visible. The cookie will also be visible to all subdomains.

secure

Boolean indicating whether the cookie transmission requires a secure protocol (https).

sameSite

A string allowing to control whether the browser is sending a cookie along with cross-site requests.


Add glouton to your shiny app

Description

Add glouton to your shiny app

Usage

use_glouton(online = TRUE)

Arguments

online

TRUE fetch the online version of js-cookie through CDN. FALSE uses the file included in the pckage.