I have a shiny app deployed on a Linux server. I want the app to timeout if there is no activity for a minute. Based on what I read, I added the line app_idle_timeout to the shiny-server.conf file but I notice that it doesn't work. Can someone please advice how I can ensure that the session times out after a minute? Note: I do NOT have shiny server PRO.
Below is what my shiny-server.conf looks like.
Instruct Shiny Server to run applications as the user "shiny"
run_as shiny;
# Define a server that listens on port 3838
server {
listen 3838;
# Define a location at the base URL
location / {
# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;
app_idle_timeout 60;
# When a user visits the base URL rather than a particular application,
# an index of the applications available in this directory will be shown.
directory_index on;
}
}
~
The session timeout feature isn't available on the open source shiny server. It comes only as part of the pro version.
@Pork Chop, thanks for your very useful answer!
Just for the sake of completeness, here is a slightly modified version of @Pork Chop's code which doesen't close the browser tab, but instead only closes the session and leaves a message for the user:
This was very helpful to get here.
You can configure your
idle
time within theshiny
app like so using some JS, here the app will timeout after 5 seconds.