Punched out some code for ya. 
 
If a user does not move the mouse while having the window focused within a time frame (15 mins coded now), the browser erases the content from the page, then moves you to a new page.  I would assume the next CF page you would delete all the session and client information and make them re-login.  =P
 
Using this, you could set your inactivity timeout very long (maybe 120 mins), as long as someone is sitting at the page and doing something, they wont timeout until the 120 minute mark is reached.  However if they leave thier computer or screen for longer than 15 mins, they get booted.
 
Works in IE right now, can write the JS equivalent fairly easily, just differences in the event object really. 
 
Fairly snazzy security addition perhaps.  Add a couple other events, cross compatibility it and could prove kinda neat.
 
<html>
<script>
 sessionTimer = null;
 sessionCounter = null;
 function madeActive(){
  sessionCounter = 0;
 }
 function checkMouseMove(){
  if(sessionCounter < 9000){
   sessionCounter++
   showThis(sessionCounter);
   sessionTimer = setTimeout('checkMouseMove()', 100);
  } else {
   document.open();
   window.location = 'test.cfm';
   alert('you timed out!');
  }
 }
 function showThis(testTxt){
  //statusTxt = "Inactive for: " + (testTxt / 10) + "seconds";
  //window.status = statusTxt;
 }
</script>
<body >
... [your page here] ...
</body>
</html>
 
Nate Nielsen
817.726.8644
----- Original Message -----
Sent: Thursday, February 21, 2002 3:50 PM
Subject: RE: session expire

If you were to use location.replace, the user would not be able to go �back� to the page.

 

<script language=�JavaScript�>

            function tOut() {

                        location.replace(�timeout.cfm�);

            }

</script>

 

<body class=GramE>setTimeout(�tOut()�,120000)�>

 

That would replace the page with timeout.cfm after 120 seconds.

 

David Grant

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Gregory Price
Sent:
Thursday, February 21, 2002 3:47 PM
To: [EMAIL PROTECTED]
Subject: Re: session expire

 

yeah, i was looking for a javascript... but this is probably easier, thanks

----- Original Message -----

Sent: Thursday, February 21, 2002 3:43 PM

Subject: RE: session expire

 

Well, there�s no way for the server to talk to the client when the session dies.  That�s the whole point of sessions expiring � there has been no communication from the client.  However, you can use the meta refresh tag and set it�s interval to your session timeout � it won�t kick off unless the user sits for that long, in which case the session has died:

 

<meta http-equiv="REFRESH" content="1200; url=RIPPoorSession.cfm">

 

---
Billy Cravens

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Gregory Price
Sent:
Thursday, February 21, 2002 3:37 PM
To: [EMAIL PROTECTED]
Subject: session expire

 

I want to shoot a user off to another page as soon as their session expires without any user action so information isnt left on the screen.  anyone know how?

 

greg

Reply via email to