I like Mary Jo's suggestion and would add 1 item.
This method will keep the session alive for as long as the page is open in a
browser, it does not, however, verify that the user is still using the page.
One thing that I have used in the past is added a 'confirm('Unless you click
the \'ok\' button now, you will be logged out.
If they click on either button, then you can run the keepAlive function.
Just an idea.
Also, you might even consider adding a 'save work' button that would save
what was typed in your database, but not 'publish' it. This would allow
those users who are writing novels in your website to avoind losing their
work, javascript enabled or not. (the action of saving would also allow the
session to stay alive automatically.)
William
--
William E. Seiter
Have you ever read a book that changed your life?
Go to: www.winninginthemargins.com
Enter passkey: goldengrove
Web Developer
http://William.Seiter.com
-----Original Message-----
From: Mary Jo Sminkey [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 19, 2008 4:39 PM
To: CF-Talk
Subject: Re: Keep session alive for form
> Any ideas for keeping this session alive? I tried implementing an
> IFRAME to routinely hit a keepAlive.cfm page in the background - but
> that seems so rudimentary and cumbersome - plus it didn't work 100% of
> the time in my testing.
Well, here's a little script I have used, obviously only works for users
with javascript enabled, but that's a pretty good percentage these days.
'image.cfm' just needs to be some CF page that sits under your
Application.cfm (or .cfc) it doesn't really need to do much. But the script
will make sure it gets called every 15 minutes and keep the session alive.
Obviously you can just put the actual number of milliseconds in that last
statement, rather than writing it out as I have here.)
//calls a cfm page to refresh the user session every 15 minutes
function keepAlive() {
var imgAlive = new Image();
var d = new Date();
imgAlive.src = 'image.cfm?d=' + d;
}
setInterval('keepAlive()', 15*60*1000);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296906
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4