In my application, we have a session with a 60 minute timeout. Organizers sometimes execute long running tasks or they leave their computer in the middle of something and return only to find out on the next submit (sometimes after accomplishing much work) that they are prompted for a username and password again. This causes quite a bit of frustration.
To combat this, we placed a session timeout counter next to the “Logout” link counting down from 60 minutes and alerting the user at both 10 and 5 minutes that they should save their work if necessary. This was nice, but still placed the onus on the user.
Thanks to dojo.io.bind(), we now have an automatic (via setInterval()) process that pings the server every 50 minutes to keep the session alive as long as the browser is open. It was working great in Firefox but for some reason didn’t seem to be firing in IE.
By setting the interval to 2000ms and adding in some dojo.debug()s, I could see that Dojo was calling the server every 2 seconds but that the server was returning the same value in IE. Caching! Should have known. By adding the preventCache argument to my bind() call, no more problems with dojo.io.bind() seemingly not working in IE:
In this case, I don’t have an error or load function for handling results from the call. I don’t want to do anything with the results; merely requesting the ColdFusion page will refresh the session timeout on the server side so I use the catch-all “handler” routine to silently ignore everything that comes back.