To use session variables, you must enable them in two places:
cfapplication
tag.
ColdFusion MX Administrator, Application.cfc, and the cfapplication
tag also provide facilities for configuring session variable behavior, including the variable time-out.
To use session variables, they must be enabled on the ColdFusion MX Administrator Memory Variables page. (They are enabled by default.) You can also use the Administrator Memory Variables page to do the following:
You must also enable session variables in the initialization code of your Application.cfc file or in the cfapplication
tag in your Application.cfm file.
Do the following in the Application.cfc initialization code, below the cfcomponent
tag, to enable session variables:
CreateTimeSpan
function to specify the number of days, hours, minutes, and seconds for the time-out.
Do the following in the Application.cfm file to enable session variables:
sessionManagement="Yes"
name
attribute to specify the application's name.
sessionTimeout
attribute to set an application-specific session time-out value. Use the CreateTimeSpan
function to specify the number of days, hours, minutes, and seconds for the time-out.
The following sample code enables session management for the GetLeadApp application and sets the session variables to time out after a 45-minute period of inactivity:
<cfapplication name="GetLeadApp"
sessionmanagement="Yes"
sessiontimeout=#CreateTimeSpan(0,0,45,0)#>