https://github.com/sellorm/shiny_cookies
Example shiny app with cookie controls
https://github.com/sellorm/shiny_cookies
Last synced: 4 months ago
JSON representation
Example shiny app with cookie controls
- Host: GitHub
- URL: https://github.com/sellorm/shiny_cookies
- Owner: sellorm
- Created: 2023-06-28T16:14:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-28T16:43:09.000Z (almost 2 years ago)
- Last Synced: 2025-01-05T12:12:34.723Z (5 months ago)
- Language: R
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - sellorm/shiny_cookies - Example shiny app with cookie controls (R)
README
# Handling cookies in Shiny apps
This repo contains a small demo app that illustrates one way to work with
cookies within a Shiny app.All the real work is offloaded to javascript with information being passed
back into the app through Shiny's javascript interface, specifically,
`Shiny.onInputChange()`.This aproach is very lightweight, but other approaches also exist such as the
[cookies](https://cran.r-project.org/package=cookies) package, which you may
prefer.Run the `app.R` file (Mac and Linux users can also start the app with the
`app.sh` script) to see an interactive demo of the cookie handling.Besides the `app.R` file, the only other requirement is the `www/cookies.js`
javascript file. This contains some helper functions for use in the embedded
javascript that's inline in `app.R`.