extract_cookie | R Documentation |
The shiny request object includes any cookies that are available to the app. This function extracts the value of a named cookie from that request.
extract_cookie(request, cookie_name, missing = NULL)
request |
A shiny request object. |
cookie_name |
The name of the cookie. Can contain any US-ASCII characters except for: the control character, space, a tab, or separator characters like ( ) < > @ , ; : \ " / [ ] ? = { }. |
missing |
The value to return if the requested cookie is not stored in
the request. Defaults to |
The contents of that cookie.
req <- list(HTTP_COOKIE = "cookie1=expected_value; cookie2=1; cookie3=2")
extract_cookie(req, "cookie1")
extract_cookie(req, "cookie2")
extract_cookie(list(), "cookie1")
extract_cookie(NULL, "cookie1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.