Skip to content

helps in closing a shiny session

2 messages · Cleber N.Borges, Bert Gunter

#
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 )
#
Shiny is a product created and supported by Posit.co, formerly known as
Rstudio. They have their own support forum here <https://posit.co/support/>
, which is likely a better place to post such queries.

Cheers,
Bert


On Tue, May 30, 2023 at 6:58?AM Cleber Borges via R-help <
r-help at r-project.org> wrote: