How to use session $ userData correctly in Shiny
What's the correct way to get / set values ββin session$userData
for shiny applications? The documentation states :
userData: environment for application authors and module / package authors to store any data needed for a session.
And userData
is only available when running in applications on the Shiny server after the user is logged in?
I tried to work with session$userData
while running the application from the RStudio IDE, but session$userData
- NULL
and I get errors saying "cannot add bindings to locked environment".
library(shiny)
ui <- fluidPage()
server <- function(input, output, session) {
# Returns NULL
print(session$userData)
# will throw an error
session$userData$test <- "test value"
attr(session$userData,"test") <- "test value"
}
shinyApp(ui = ui, server = server)
Possibly related:
source to share
No one has answered this question yet
Check out similar questions: