Subscribe via Feed
, Aug 21, 2009 9:48:29 PM
5 responses to Checking for Idle Session Timeout Client-Side and Redirecting
aj, February 4, 2010 7:24 AM
I have a situation where when the user closes the browser window the user is "disconnected" from the chat application, its handled in dojo, but suppose when the user closes the browser through say a end task(in windows) how do we handle such a situation. Ideally i want to show that the user has been "disconnected" or "logged out" of the room. Im using dojo version 1.4. Any insight on this would be highly appreciated.
Jeremy Hodge, September 9, 2009 7:03 PM
Nathan, September 9, 2009 2:12 PM
Just a quick newby question......where would I place this code?
Jeremy Hodge, August 22, 2009 1:01 PM
Yes, It would be possible. If you look at the advanced in page login example I posted earlier on this blog, there is a link that pops up the ajax login dialog box. If you were to give the link an id, you should be able to call dojo.byId("IDGOESHERE").click() instead of the window.location.href and it would pop up the dialog to log in.
I'm sure you know already, but if you rely solely on countdown like you described, with xPages and partial refreshes, you would have to get the countdown to restart on every partial refresh, as you can't rely on the full page refresh to reset the counter (and each partial refresh would reset the idle time out). That's why its best to check back with the server...
Jan Schulz, August 22, 2009 12:33 PM
We use something similar (but a little dumper): just count down a little less than the normal idle countdown and popup a alert box.
Anyway: I wonder if it would be possible to detect, that the session timout is finished, it will show a small login window and autenticate the user again via ajax calls. Redirecting means that the users is pulled out of the normal workflow and might loose data (form content).