Every .cfm page request, regardless of session variable usage, within a
given application, resets that particular session's timeout counter.

CF's session management is related to the session cookies (cfid/cftoken
or the J2EE session) that are automatically set, by ColdFusion.  You do
not need to create your own session variables to continue the session.

CFDUMP the session and cookie scopes once you have enabled session
management and you will see what is created.  Then, try a few things,
like deleting the cookies, closing the browser, and you will see how CF
handles the session management.

M!ke

-----Original Message-----
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 25, 2006 3:53 PM
To: CF-Talk
Subject: What determines session inactivity timeouts?

What started out as a simple exercise has gone crazy.  All I wanted to
do was to give my users a warning of impending session timouts and give
them the opportunity to refresh the session.  I tried using the
<CF_SessionWatch> tag but it's a bit too simplistic - I used it to setup
a JS call to set a timer for a few minutes less than the session timeout
value, but if the user takes longer to respond (maybe they walked away
from their PC) than the remaining session timeout, then when the user
comes back and clicks on the "yea I want to keep working" option, the
resulting  attempt to touch a page in the app (to reset the session
timeout) ends up causing the login page to come up (since by then the
session vars have timed out), so now the user is real confused (because
he has his original page, as well as a login page in the pop-up window).

So, I added a bit more JS so that when the warning pop-up comes up, it
first sets a timer for about a minute less than the amount of remaining
session var time, and if *that* timer fires, then I log the user off and
force the opener page to go back to the home page, and do a
window.close() to get rid of the pop-up window.

Sounds fine, right?  Here's my concern - what if the page that is
executing takes longer to execute than the session timeout value?  Our
server is set for 1 hour max timeout, and some of the data loading
screens can take longer than that to run, especially when the CF or SQL
server is loaded.  I don't want to have it whacked in the middle of it's
work by the session timeout checker.

So this leads to my initial question, which I've never thought about
before even though I've been using session vars for years and years -
what exactly constitutes "inactivity" in CF's perspective?  What if a
long running page doesn't touch any session vars for a period of time
greater than the session var timeout?  Is session "activity" defined by
a request being active, or by the actual touching of a session-scoped
var? Do I need to have potential long-running pages periodically touch a
session var?

I thought about moving the code for setting up the JS timers from the
application.cfm file to orequestend.cfm, which wouldn't start up the
timers until the page actually completes, but then that has a bunch of
problems with respect to errors and <CFABORT>.

Am I making this harder than I need to?

thanks
Reed

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238736
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to