Occassionally... when I need to do this... I set the session timeouts to
something very low like 20 seconds, then have a JavaScript routine that
requests a cf page with httpRequest every 10 seconds.
So every 10 seconds, the JS routine resets the session timeout to 20 secs.
If the browser is closed, the session times out 20 seconds later.
It doesnÂt really matter what CF page you request as long as it is under the
same application so the session is reset. I usually like to return
something... anything... Like another script to run
Say the calling page checks the session... if it doesnÂt exist for some
reason... the user will need to log in again. So you could send back a line
like...
alert('Your session has timed out. You will need to login\nagain with the
next page refresh. Please save any information you have\ntyped blah blah
blah");
If the session is ok.. then just return void(0); so nothing happens.
That is quick and dirty of course. It would be much nicer to display a
hidden div or something with a login form anytime the session is dead then
use httpRequest to post that form to a login routine without disturbing the
flow of things. A form would just display... the user would login back in...
the form would disappear and the user would still be on the same page at the
same place they were when the form popped up.
-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED]
Sent: Monday, April 02, 2007 10:18 PM
To: CF-Talk
Subject: Logout vs just closing the browser
Ok - have an app with a logout page that destroys all client/session
variables. No problem. Works great.
BUT - what if somebody doesn't log out and just closes the browser? Is
there any way to destroy everything when that happens?
I've not found a definitive source of info on this anywhere yet still
researching...
Is there a good reference anywhere.....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2
Build sales & marketing dashboard RIAâs for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274397
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4