remove_cookie: Remove a cookie

View source: R/server.R

remove_cookieR Documentation

Remove a cookie

Description

Instruct the user's browser to remove a cookie via JavaScript.

Usage

remove_cookie(cookie_name, session = shiny::getDefaultReactiveDomain())

Arguments

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 ( ) < > @ , ; : \ " / [ ] ? = { }.

session

Shiny session in which the cookies can be found (the default should probably always be used).

Value

A call to session$sendCustomMessage() which removes the targeted cookie.

Examples

server <- function(input, output, server) {
  shiny::observeEvent(
    input$button_that_removes_cookie,
    remove_cookie("my_cookie")
  )
}

cookies documentation built on Oct. 3, 2023, 1:07 a.m.