It is possible to execute some code R on ending the session of a Shiny app with the help of session$onSessionEnded. However, there\'s an issue if we use that to
session$onSessionEnded