we use this...
change arg = arg + "/goo/foo.cfm"  to point to your logout code.

<!--- The time out code --->
<script language="JavaScript"><!--
//session timer variables
var g_nSessionTimeout   = 20; // time out in minutes
var g_nSessionWarn              = 0; //when to warn ** g_nSessionTimeout - 
g_nSessionWarn = displayed time when warning is displayed
var g_nStopMinutes              = ( g_nSessionTimeout - 1 );
var g_nStopSeconds              = 59; 


function stop() {
   clearTimeout(tick);
   }
   
function sessionTimer() 
{  
         
  if ( g_nSessionTimeout != 0 )
  {
        if ( g_nStopSeconds == 0 )
        {
                g_nStopSeconds = 59;
                g_nStopMinutes = ( g_nStopMinutes - 1 );
                if ( g_nStopMinutes == ( ( g_nSessionTimeout - g_nSessionWarn) - 1 ) )
                        window.alert('For security reasons your session will \n time 
out in ' +  (g_nSessionTimeout - g_nSessionWarn)  + ' minutes if there is no 
activity.');
        }
        else
                g_nStopSeconds = (g_nStopSeconds - 1);
        
        if (g_nStopSeconds <= 9)
                g_nStopSeconds = "0" + g_nStopSeconds;
                
        window.status = ('Your Session Will Time Out In ' + g_nStopMinutes + ':' + 
g_nStopSeconds );
        
        
        if ( ( g_nStopMinutes == 0) && ( g_nStopSeconds == 0) )
        {
                window.status = 'Your sesson has been disconnected';

                var url = location.href
                arg = ""
                arg = arg + "/goo/foo.cfm"
                url1 = url.substring(0,url.lastIndexOf(".asp")+1)
                top.location.href = url1.substring(0,url1.lastIndexOf("/")+1)+arg
                
        }
        else
                setTimeout( "sessionTimer()",1000 ); 
  }
}

sessionTimer(); 

//-->
</script>

>-----Original Message-----
>From: Jim Johnson [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, August 13, 2003 4:46 PM
>To: CF-Talk
>Subject: Redirect on Session Timeout script
>
>
>Hello,
>
>I'm using session vars in my app, with the default timeout 
>setting of 20
>minutes. Does anyone have a script for redirecting to a login 
>page, if/when
>the session var has timed out?
>
>I've searched around the MM site, cflib.org and HofF archives, 
>but couldn't
>find anything.
>
>Thanks,
>
>James
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to