3 Replies Latest reply on Jul 21, 2009 10:30 AM by TLC-IT

    Session time out warning...

    emmim44 Level 1

      Hi all, I have a session time out warning message which warn the users in the 3.minute of session...but somehow it doesnt function...Any input appreciated...


      my application.cfm:


      <script language="JavaScript1.2">
        function startTimer()
         //myTime = setTimeout('ding();',60000);
         myTime = setTimeout('ding();',180000); // at the 3.Minute
         // (60000 ms in a minute, * 14)
        function ding()
          nwindow1=window.open("WarningTimeOut.cfm","","height=140,width=585,left=200,top=180,scrol lbars=no,toolbar=no,status=no,menubar=no,resizable=no",bReplace="true");
          //alert('dinner is served!');
        function ajx()
         if (typeof window.ActiveXObject !='undefined' )
         { xmlDoc =new ActiveXObject("Microsoft.XMLHTTP"); }
         { xmlDoc =new XMLHttpRequest(); }
         var myRand =new Date().getTime();
         var myPage ='application.cfm?stamp='+ myRand;
         xmlDoc.open( "GET", myPage, true );
         xmlDoc.send( null );
         if (window.opener.nwindow1)

        • 1. Re: Session time out warning...
          TLC-IT Level 3

          I did not attempt to study your code too closely, but this is what I do...


          I set up a timer to go off [i]continuously,[/i] say every 30 seconds or so.  And what it would do, in the case of a 3-minute timeout, is to increment a variable.  If the variable's value becomes "5," a warning message is displayed to the effect that the session will time-out in 30 seconds.


          Meanwhile, there's another little function that's called at strategic places throughout the code, and what it does is to reset that counter to zero.  We call this function anytime we do anything useful.  (There is a function to do this... we don't diddle with the counter directly, everywhere in our code.)


          Now, this of course is an "inactivity timer," but that's basically how session-management typically works:  the session dies after so-many minutes of inactivity.


          The timer doesn't stop running.

          • 2. Re: Session time out warning...
            emmim44 Level 1

            Thank you...do you have a sample?

            • 3. Re: Session time out warning...
              TLC-IT Level 3

              Nope, but they're out there.  Google it.  The idea isn't exactly original . . .