Learn R Programming

shinyauthr (version 1.0.0)

js_cookie_to_r_code: Generate required Javascript

Description

This is used to generate the Javascript which gets and sets the cookies in the user's browser. We need to glue it together to handle the variable expiry time and to get the correct module namespace. This function is used internally only.

Usage

js_cookie_to_r_code(id, expire_days = 7)

Arguments

id

name of input object to hold the cookie value

expire_days

number of days to ask browser to retain cookie

Value

Character string of Javascript code

Examples

Run this code
# NOT RUN {
shinyjs::extendShinyjs(
  text = js_cookie_to_r_code(ns("jscookie")),
  functions = c("getcookie", "setcookie", "rmcookie")
)
# }

Run the code above in your browser using DataLab