I want to add/modify HTTPOnly cookies from server.R in R Shiny Application. I've tried session$request$HTTP_COOKIE <- paste0(session$request$HTTP_COOKIE[1], "; t=hello") where "t=hello" is my desired cookie-value pair, but it doesn't work. It prints as result, but doesn't actually add to cookies which can be checked from browser.
library(shiny)
ui <- fluidPage(
textOutput("cookie"),
br(),
tableOutput("table")
)
server <- function(input, output, session){
session$request$HTTP_COOKIE <- paste0(session$request$HTTP_COOKIE[1], "; t=hello")
output$cookie <- renderPrint({
session$request$HTTP_COOKIE
})
}
shinyApp(ui, server)
Any kind of guideline would be very much helpful.