read_session_cookie: Read or Create the Session Cookie

read_session_cookieR Documentation

Read or Create the Session Cookie

Description

The user session contains the user's id and is stored in the client's browser as cookie. This function should not be called directly by itself, but rather through the setup function setup_user_session.

Usage

read_session_cookie(
  appid,
  domain = shiny::getDefaultReactiveDomain(),
  param_name = "userid",
  session_length = 0.125
)

Arguments

appid

Application id. All applications with the same ID share the same session.

domain

Shiny reactive domain.

param_name

URL query string parameter name to extract the user id from.

session_length

Duration for how long the session is to be active (in days).

Details

For the session logic to work, the shiny app needs to have shinyjs loaded and the session.js file included from system.file('inst', 'js', 'session.js', package = 'stat305templates'). See the templates as provided by this package how this can be accomplished.

Value

the user id as given in the query string or as saved in the user session.


dakep/stat305templates documentation built on Nov. 27, 2022, 8:23 a.m.