Configuring and enabling session variables

To use session variables, you must enable them in two places:

ColdFusion MX Administrator, Application.cfc, and the cfapplication tag also provide facilities for configuring session variable behavior, including the variable time-out.

Selecting and enabling session variables in ColdFusion MX Administrator

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:

Enabling session variables in your application

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:

Do the following in the Application.cfm file to enable session variables:

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)#>

View comments in LiveDocs