Lorem ipsum dolor sit amet, consectetur adipisicing elit...

How it works

After a set amount time (set to 3 seconds for this demo), a dialog is shown to the user with the option to either log out now, or stay connected. If log out now is selected, the page is redirected to a logout URL. If stay connected is selected, a keep-alive URL is requested through AJAX. If no options is selected after another set amount of time, the page is automatically redirected to a timeout URL.

You can start the timeout timer on your own event (you could for example check for a period of mouse inactivity, or lack of keyboard input).