|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
session variable timeout
I think I know this, but want to verify.Matthew Smith 03/12/10 10:24 A > If I do a isdefined on one session variable, is the timeout for all sessionDave Watts 03/12/10 10:41 A I'd think yes since it was defined when the request was made.Bobby Hartsfield 03/12/10 10:44 A Kinda and yes. Simply accessing the page within the timeout limitMike Chabot 03/12/10 10:44 A Ok, just to clarify, does the count down restart with the load ofMatthew Smith 03/12/10 12:45 P > Ok, just to clarify, does the count down restart with the load ofDave Watts 03/12/10 12:56 P The timer is reset when the session object is referenced, whichMike Chabot 03/12/10 01:41 P Cool. Thank you.Matthew Smith 03/12/10 04:21 P I think I know this, but want to verify. If I do a isdefined on one session variable, is the timeout for all session variables reset? So if I have a isdefined("session.loggedin") check and it is true, I can assume that all session variables are still defined, assuming they were coming into that portion of the code? Thanks! > If I do a isdefined on one session variable, is the timeout for all session > variables reset? No. The timeout is reset on every subsequent request by a user. > So if I have a isdefined("session.loggedin") check and it is true, I can > assume that all session variables are still defined, assuming they were > coming into that portion of the code? Generally, yes, unless you've done something to manipulate the contents of the Session scope. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. I'd think yes since it was defined when the request was made. I think I know this, but want to verify. If I do a isdefined on one session variable, is the timeout for all session variables reset? So if I have a isdefined("session.loggedin") check and it is true, I can assume that all session variables are still defined, assuming they were coming into that portion of the code? Thanks! Kinda and yes. Simply accessing the page within the timeout limit should maintain the session. Your code in the second question should be an adequate check of whether or not the session is active. All session variables inside the user's session would expire at the same time. StructKeyExists(session,"loggedin") is more efficient than IsDefined(). -Mike Chabot ----- Excess quoted text cut - see Original Post for more ----- Ok, just to clarify, does the count down restart with the load of application.cfm, or is it when a session variables is referenced? ----- Excess quoted text cut - see Original Post for more ----- > Ok, just to clarify, does the count down restart with the load of > application.cfm, or is it when a session variables is referenced? It restarts on every subsequent request made by that browser. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. The timer is reset when the session object is referenced, which happens on every page request. ColdFusion touches the session object on every ColdFusion page request, even if you don't specifically do this in your code. The session timer is not reset if you access file types that aren't served by CF, such as HTML files. There are some hidden functions which allow you to list out every session for every user within the application, not just the current session for the current user. So you could see, for example, that there are 20 active sessions on your server and you can see details about each session. One side effect of making use of this unofficial ability is that all the timers for all the user session get reset when you list them out like this, simply because you touched every session in order to list them out. Below is a CFC function that you can ping every X minutes from inside of an Adobe Flex app in order to keep the session alive on the ColdFusion server. Notice how the function is empty, yet it does the job. <cffunction name="keepSessionAlive" access="remote" output="no"> <!--- Do nothing here ---> </cffunction> -Mike Chabot ----- Excess quoted text cut - see Original Post for more ----- Cool. Thank you. ----- Excess quoted text cut - see Original Post for more -----
|
July 31, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||