Updating User Session with Ajax - Round 2
Well back by popular demand is updating your user's session with Ajax. Back in this blog posting: http://radio.javaranch.com/pascarello/2005/07/05/1120592884938.html I wrote a little script that used a confirm to update the session with Ajax.
Now of course that causes some trouble with the user not answering the confirm, removing focus from the element, and so on. With that in mind I rewrote the JavaScript functionality to make it more user friendly and give it that rich user interface people want.
It now uses a layer to float onto the page so we do not disrupt the user's actions when it comes on the screen. It also changes the message when the message has been on the screen after a set period of time. No more update your session message after it has expired. Plus I am using some code from my book Ajax In Action to make the request as easy as possible. The .net loader is explained in it in detail, so if you like it then you may want to pick up the book to learn more.
The Ajax Session Management script is avaiable on my website at:
http://www.pascarello.com/AjaxSessionTimer.aspx
Tell me what you think, any changes, etc.
Eric Pascarello
Moderator of HTML/JavaScript at www.JavaRanch.com
Author of: JavaScript: Your Visual Blueprint for Dynamic Web Pages