[R] helps in closing a shiny session

Cleber Borges k|ebyn @end|ng |rom y@hoo@com@br
Tue May 30 15:57:52 CEST 2023


Hello everybody

I tried closing a shiny session with the call: session$close() and then 
I found that it didn't do what I thought it would.

The result of calling: session$isClosed() is still FALSE.

Does anyone have any tips on how to close the shiny session using a button?

Thanks in advance for any help

yours sincerely.,

Cleber Borges

----------------------- CODE----------------------------

ui <- fluidPage( actionButton( "disconnect", "disconnect" ) )

server <- function( input, output, session ) {
     observeEvent( input$disconnect, {
         session$close()
         res <- session$isClosed()
         print( paste0( "result of function isClosed() is: ", res ) )
     })
}

shinyApp( ui, server )

	[[alternative HTML version deleted]]



More information about the R-help mailing list