<cfcomponent
displayname="Application"
output="true"
hint="Handle the application.">
<!--- Set up the application. --->
<cfset THIS.Name = "Marks CFC App"/>
<cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 2, 0, 0 )/><!--- days, hours, minutes, seconds --->
<cfset THIS.SessionManagement = true/>
<cfset THIS.SetClientCookies = true/><!--- without this the CFID and CFTOKEN need to be passed in the URL between pages --->
<cfset THIS.SessionTimeout = CreateTimeSpan( 0, 0, 0, 10 )/>
<cfif not IsDefined("cookie.cfid")>
<cflock scope="session" type="readonly" timeout="5">
<cfcookie name="cfid" value="#session.cfid#">
<cfcookie name="cftoken" value="#session.cftoken#">
</cflock>
</cfif>
Then I have a .cfm page that outputs the application data:
<cfoutput>
<!--- Create a new instance of the application object. --->
<cfset applicationInstance = createObject(
"component",
"Application"
) />
<!--- Dump out the application instance. --->
<h4>Application Instance Dump</h4>
<cfdump
var="#applicationInstance#"
label="Application Instance"
/>
<h4>Session Dump</h4>
<cfdump var="#session#">
</cfoutput>
I navigate to this page and see the structs, and the session struct shows me a cfid of 2690. I then sit on this page for way longer than the session timeout of 10 seconds, and refresh the page. Shouldn't the cfid change? I even close the browser and reopen to this page and the cfid is still 2690. I imagine ColdFusion is getting this from the cookie, but I thought I was expiring those when the browser closes.
Any help with understanding this would be pretty cool! Thanks!

New Topic/Question
Reply




MultiQuote





|