Using Session Timeout And CreateTimeSpan() - Subtle Caveat

<cfcomponent>
 
	<cfset THIS.Name = "SessionTimeoutTest" />
	<cfset THIS.ApplicationTimeout = CreateTimeSpan( 0, 1, 0, 0 ) />
	<cfset THIS.SessionManagement = true />
 
 
	<!---
		Check to see which session timeout we are
		going to utilize.
	--->
	<cfif StructKeyExists( URL, "a" )>
 
		<!---
			Here, we are going to try to use the result of
			the CreateTimeSpan() without calling the method.
			CreateTimeSpan() for 5 minutes results in the
			number: 0.00347222222222. Use this instead of
			the method call.
		--->
		<cfset THIS.SessionTimeout = 0.00347222222222 />
 
	<cfelseif StructKeyExists( URL, "b" )>
 
		<!---
			Try to set an intermediary variable that stores
			the result of the CreateTimeSpan() method, and
			then applies that to the application setup.
		--->
		<cfset dtTimeSpan = CreateTimeSpan(
			0, <!--- Days. --->
			0, <!--- Hours. --->
			5, <!--- Minutes. --->
			0 <!--- Seconds. --->
			) />
 
		<!--- Set the sessiontimeout. --->
		<cfset THIS.SessionTimeout = dtTimeSpan />
 
	<cfelseif StructKeyExists( URL, "c" )>
 
		<!---
			Try to set an intermediary variable that stores
			the value we built in "a" and then applies that
			to the application setup.
		--->
		<cfset dtTimeSpan = 0.00347222222222 />
 
		<!--- Set the sessiontimeout. --->
		<cfset THIS.SessionTimeout = dtTimeSpan />
 
	<cfelseif StructKeyExists( URL, "d" )>
 
		<!---
			Try to set an intermediary variable that stores
			the value we built in "a". However, this time,
			store the value as a Java Double. and then applies
			that to the application setup.
		--->
		<cfset dtTimeSpan = JavaCast(
			"double",
			0.00347222222222
			)/>
 
		<!--- Set the sessiontimeout. --->
		<cfset THIS.SessionTimeout = dtTimeSpan />
 
	<cfelse>
 
		<!---
			For our default, we are just going to use
			the CreateTimeSpan() directly.
		--->
		<cfset THIS.SessionTimeout = CreateTimeSpan(
			0, <!--- Days. --->
			0, <!--- Hours. --->
			5, <!--- Minutes. --->
			0 <!--- Seconds. --->
			) />
 
	</cfif>
 
 
	<!--- Set page settings. --->
	<cfsetting
		showdebugoutput="false"
		/>
 
</cfcomponent>

For Cut-and-Paste