could you please add a simple demo for an automatic application session timeout ?
TASK: Application will automatically logout (run logout action) after certain time which elapsed after user's inactivity with application.
How to catch a user's application inactivity?
asked 26 Sep '12, 23:32
I prepared the demo application, here's the link;
In this demo application, the session timeout value of the application is 10 seconds. A timer with an interval value of 5 seconds starts just when the application opens (see startSessionTimeoutChecker procedure). In fact, this timer send a dummy request to the server at every 5 seconds, which forces the server to generate the "Session Expired" event if it's necessary (if the session is timed out). Therefore, at worst case, you will be able to catch the user inactivity with a 5 second delay. Since it's demo application I used 5 seconds as timer interval value but in a real application, we do not recommend an interval value value lesser than 60 seconds.
When the "Session Expired" event of the application occurs, you can apply your logout logic (see sessionExpired procedure). Additionally, after applying the logout logic, I show an alert to inform the user about the session timeout and then restart the application.
Step by step implementation
that's perfect - exactly what we need.
Would you mind to send me this demo to my email, as currently I'm having a problem to see a "Design XML" tab under demos. Issue logged in other threat: http://osqa.theformspider.com/questions/532/problem-to-see-code-in-design-xml-tab-in-demos
Kind regards, Tomas
answered 27 Sep '12, 07:06