You could do it with javascript and DHTML, something like this -

<cfset TimeoutSecs = 30>

<div id="Countdown">
You will timeout in #TimeoutSecs# seconds
</div>

<script language="javascript">
 var Timer = #TimeoutSecs#
 window.setTimeout( "tick();", 1000 );

 function tick()
 {
        Timer = Timer - 1;
        if( Timer > 0 )
        {
                document.all['Countdown'].innerHTML = "You will timeout in "
+ Timer + " seconds";
                window.setTimeout( "tick();", 1000 );
        }
        else
        {
                alert( "You have timed out!" );
                self.location="timeout.cfm";
        }
 }
</script>

It would need a bit of modification to work in Nutscrape, but I hope that
helps!

Cheers,

Alistair Davidson
Senior Web Developer 
Rocom New Media
www.rocomx.net


-----Original Message-----
From: Neil H. [mailto:[EMAIL PROTECTED]]
Sent: 22 May 2001 15:59
To: CF-Talk
Subject: Session Solution.


I have been skirting the issue here for a while I am simply trying to notify
a user when their session will timeout.  I would like it to count down.
Like a dialog box that says you will timeout in 5 minutes and counts down?

Any ideas?

Thanks,

Neil
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to