Forum Moderators: phranque
The client wants me to provide a method that initiates a prompt every ** minutes that the user needs to click. This is an online testing environment and we need to make sure the user remains active during their session. If they are inactive for too long (** minutes) then the prompt initiates. That prompt will remain on screen for ** minutes at which time it will close and log the user out. At that time we capture the logout date and time.
Windows Server 2003 IIS 6
1) Log the time each user hits a page
2) The next hit check the time difference from this hit from the last.
3) If the time difference is greater then the threshold time you want them to be 'idle' then expire their cookie, for me with no auth cookie they will get redirected to a page explaining that they need to log in as their session has expired.
4) If the time difference is less then the threshold time then log that hit as their last page hit.
A couple lessons I have learned from this is to not keep a log of all pages hits but rather just update a field "last_page_hit_time". Also you may want to have a dedicated DB who's sole purpose is to log these hits with a seperate connection object for just those hits. Takes the strain of any production database you have working as well.
Obviously for you you would want to send a popup that has a timer on it. If the timer runs out without being interupted then you could expire their cookie.
[edited by: Demaestro at 4:02 pm (utc) on Aug. 22, 2006]
2) The next hit check the time difference from this hit from the last.
That is the difference here though, if I understand P1R correctly. Rather than be reactive, he wants to be proactive. Outside of some type of meta-refresh going on in the browser you will likely need to run some form of activeX control or applet in the browser.
On the other hand, isn't that type of proactive pop-up going to drive your end user nuts while s/he is reviewing information on the display? I know I would certainly be frustrated with a timer pushing me every few seconds/minutes while I am trying to concentrate. Just an idea to throw back at your client and/or design team.
On the other hand, isn't that type of proactive pop-up going to drive your end user nuts while s/he is reviewing information on the display?
Due to the requirements of this type of education, the accrediting agency requires this type of environment for the user. We also have quite a bit of reporting that relies on the users login and logout information.
These will be 30 minute prompts, not too annoying but required to determine user activity. If they are not there after 30 minutes, we've got to log them out of that session. They can then log back in and begin where they left off.
I know I would certainly be frustrated with a timer pushing me every few seconds/minutes while I am trying to concentrate. Just an idea to throw back at your client and/or design team.
Oh, he understands completely. Unfortunately due to the requirements of the accrediting agency, his hands are tied.
Sorry I slightly misread you requirments.
Have a js function that starts running a countdown at start of any page hit, if it reaches X without a new page load then it calls a 2nd function that is the alert. If X time without a response to the alert then redirect them to a page that logs them out and logs the logout.
Have you used any of the Yahoo Library? If not I can tell you that most of the code you need is there.
[edited by: Demaestro at 9:56 pm (utc) on Aug. 22, 2006]