## Concept

Wait 10 seconds, you will see a expiring warning. Wait 10 more seconds and you will see that you have been logged out.

In the real world I forward them to the logout url, which intern fowards them to login screen, instead of showing the 2nd dialog. You can modify the app.session.logout function.

We could use the active.idleTimer event to clearTimeout, however I prefer the user to explicitly say they want to keep the session open by clicking ok, not just moving the mouse on the screen.

This demo takes into account when a mobile device closes the browser, and after the idle timeout expires, launches the browser again. Instead of displaying the warning, it will jump straight to the logged out dialog.

For this demo we've enabled localStorage to sync accross tabs of the same browser. This will keep the client side happy, but we still need a keepAlive service to keep the server side session active.

For the sake of complete demo, I've included the code needed to call a keepalive url to keep the server side session valid.

##### Session Expiration Warning

You've been inactive for a while. For your security, we'll log you out automatically. Click "Stay Online" to continue your session.

Your session will expire in 120 seconds.

##### You have been logged out

Your session has expired.