| Title: | Cookie support for shinyEvents apps |
|---|---|
| Description: | Cookie support for shinyEvents apps |
| Authors: | Sebastian Kranz |
| Maintainer: | Sebastian Kranz <[email protected]> |
| License: | GPL >= 2.0 |
| Version: | 0.1.0 |
| Built: | 2026-05-07 07:29:18 UTC |
| Source: | https://github.com/skranz/shinyEventsCookies |
Determines whether cookies have been loaded into the current app session.
areAppCookiesLoaded(app = getApp())areAppCookiesLoaded(app = getApp())
app |
The shiny app object (default: getApp()) |
Logical value indicating if cookies were loaded
Generates HTML header elements with JavaScript to handle cookies in a Shiny app.
cookiesHeader(onload.cookies = NULL, eventId = "loadPageCookies", ...)cookiesHeader(onload.cookies = NULL, eventId = "loadPageCookies", ...)
onload.cookies |
Vector of cookie names to load on initialization (default: NULL for all cookies) |
eventId |
Character string specifying the event identifier (default: "loadPageCookies") |
... |
Additional arguments passed to underlying functions |
A tagList of HTML dependencies and JavaScript for cookie handling
Retrieves previously loaded cookies from the app's internal state.
getLoadedCookies(app = getApp())getLoadedCookies(app = getApp())
app |
The shiny app object (default: getApp()) |
The loaded cookies or NULL if none exist
Sets up an event handler to load cookies from the client browser.
loadPageCookiesHandler( fun, eventId = "loadPageCookies", no.authentication.required = TRUE )loadPageCookiesHandler( fun, eventId = "loadPageCookies", no.authentication.required = TRUE )
fun |
Function to be called when cookies are loaded |
eventId |
Character string specifying the event identifier (default: "loadPageCookies") |
no.authentication.required |
Logical indicating whether authentication is required (default: TRUE) |
Returns the result of the eventHandler call
Deletes the specified cookie from the user's browser.
removeCookie(id)removeCookie(id)
id |
The name/identifier of the cookie to remove |
No return value, called for side effect
Set a javascript cookie on the client computer
setCookie(id, values, expires = NULL, opts = list())setCookie(id, values, expires = NULL, opts = list())
id |
the name of the cookie |
values |
a named list of values, will be transformed to JSON |
expires |
if null the cookie is valid until the browser closes. If not null number of days until the cookie expires. The cookie will then persistently stored, if client computer allows |
opts |
a named list of additional options as explained on https://github.com/js-cookie/js-cookie |
Stores loaded cookies in the app's internal state.
setLoadedCookies(cookies, app = getApp())setLoadedCookies(cookies, app = getApp())
cookies |
The cookies to store |
app |
The shiny app object (default: getApp()) |
No return value, called for side effect