Package 'cookies'

Title: Use Browser Cookies with 'shiny'
Description: Browser cookies are name-value pairs that are saved in a user's browser by a website. Cookies allow websites to persist information about the user and their use of the website. Here we provide tools for working with cookies in 'shiny' apps, in part by wrapping the 'js-cookie' JavaScript library <https://github.com/js-cookie/js-cookie>.
Authors: Jon Harmon [aut, cre, cph] , Klaus Hartl [cph] (js-cookie JavaScript library), Fagner Brack [cph] (js-cookie JavaScript library)
Maintainer: Jon Harmon <[email protected]>
License: MIT + file LICENSE
Version: 0.2.3.9000
Built: 2024-11-06 13:25:10 UTC
Source: https://github.com/r4ds/cookies

Help Index


Extract all cookies from a shiny request

Description

The shiny request object includes any cookies that are available to the app. This function extracts those cookies as a named list.

Usage

extract_cookies(request)

Arguments

request

A shiny request object.

Value

All cookies in the request, as a list.

Examples

req <- list(HTTP_COOKIE = "cookie1=expected_value; cookie2=1; cookie3=2")
extract_cookies(req)
extract_cookies(list())
extract_cookies(NULL)