Awesome information! -----Original Message----- From: [EMAIL PROTECTED] [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 26, 2006 12:36 PM To: CF-Talk Subject: Re: What determines session inactivity timeouts?
OK, I did what I should have done before starting this thread, which was to rig up a test case to see what happens. Pretty interesting results. It appears that CF keeps the session vars alive during page processing, even if there is no activity with those vars. Here is what I did: In Application.cfm: <cfapplication name="test" clientmanagement="no" sessionmanagement="yes" setclientcookies="yes" setdomaincookies="yes" sessiontimeout="#createtimespan(0,0,1,0)#" applicationtimeout="#createtimespan(0,1,0,0)#" loginstorage="session"> In Test.cfm: <cfobject type="JAVA" name="obj" class="java.lang.Thread" action="CREATE"> <cfdump var="#session#"> <cfset session.x=1> <cfdump var="#session#"> #timeformat(now(),"HH:MM:SS")# <cfset obj.sleep(70000)> <BR><BR> #timeformat(now(),"HH:MM:SS")# <cfdump var="#session#"> HERE IS WHAT HAPPENED: First time I executed test.cfm, I got three CFDUMPS of the session scope: dump 1 had no vars in it, dumps 2 and 3 showed the var I set in my code. Since there was a 70 second pause between 2 and 3, and the session var timeout was set to 1 minute, that tells me that CF kept the session vars alive. I waited 2-3 minutes and reran, with the same output - which shows that CF did in fact destroy the session vars after the 60 second timeout occured between the two page requests. Then I ran another variation: I ran the script again, and then when it finished I reran it immediately, and guess what - the session var was gone! That makes it look like CF kept the session var alive during the script's execution, even though the timeout was reached, but deferred destroying the var until the request completed. So I did another scenario: ran the same test in 1 browser, but with the pause set to 2 minutes, and immediately in another browser window ran a script that simply did 2 CFDUMPs of the session scope with a 60 second pause between them. The second window (which began and ended during the first window's 2 minute pause period), showed the session var to be alive on both dumps. I refreshed it's screen immediately, and when it finished the session var was gone. This tells me that when CF "deferred" destroying the session var during the first script's execution, it kept the var alive for all other requests, not just for the currently executing one. Final test - I changed the second script's pause to be 2 minutes, and waited about 10 seconds after running the first script before starting the second, to see what happens to the session vars for the second script when it it still running after the first script ends. The session vars for the second script were still there on both dumps, which is pretty interesting because it said that when CF saw that the second script was running it kept the session vars alive, even though it never touched any of them. But the immediate rerun of the second script showed that the vars were gone as soon as it had finished. Bottom line is that session vars don't dissapear out from under you during script execution, but when the lifeguard blows the whistle the session vars are gone as soon as the last guy is out of the pool - unless someone new jumps into the pool and actually touches a session var. Whew Reed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238814 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=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

