[thelist] Cold Fusion session variables

Raymond Camden jedimaster at macromedia.com
Mon Sep 17 15:53:56 CDT 2001

> I was wondering if anyone knew how to set up a jscript alert 
> window or for 
> that matter a <cf_alert window, when a session has timed out. 
> For instance, 
> I set my timeout in my application.cfm page to 10 seconds, 
> and after 10 
> seconds I would like a pop up window saying "for your 
> protection, your 
> session has timed out and you will be redirected to the login 
> page." Ok or 
> cancel..  Something like that...

Well, first off, I certainly wouldn't use 10 seconds as a time out, but
I assume you are joking.

So, what are your options. Well, as you know, CF is a server side
language. The browser doesn't know when a session var has timed out
because the browser is client side. But, there are ways around it.

If your timeout is 5 mins, on every page, you can easily output
JavaScript code that waits 4 minutes and gives a warning. (Ie, in one
min your session will time out.)

However, this will not be perfect. If the user opens another browser
window and hits your site, thereby refreshing their session time out,
the JavaScript time out in the first window will not be in sync anymore.
However, that isn't a horrible thing per se.

> Do I need an if statement somewhere? possibly in the 
> application.cfm page? I 
> can't seem to find anything about customizing the application 
> page in any of 
> my books.
> Does anyone use bank of america online banking?

Yep, and I know exactly what you mean. They are, most likely, using the
same method.

Does this help?

Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email    : jedimaster at macromedia.com
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

More information about the thelist mailing list