Macromedia coldfusion 4.5-cfml language reference User Manual

Page of 608
14
CFML Language Reference 
SESSIONMANAGEMENT
Optional. Yes or No. Yes enables session variables. Default is No.
SESSIONTIMEOUT
Optional. Enter the CreateTimeSpan function and the values you want in days, 
hours, minutes, and seconds, separated by commas to specify the lifespan of any 
session variables that are set. The default value is specified in the Variables page of 
the ColdFusion Administrator.
APPLICATIONTIMEOUT
Optional. Enter the CreateTimeSpan function and the values you want in days, 
hours, minutes, and seconds, separated by commas to specify the lifespan of any 
application variables that are set. The default value is specified in the Variables 
page of the ColdFusion Administrator.
SETDOMAINCOOKIES
Optional. Yes or No. Sets the CFID and CFTOKEN cookies for an entire domain not 
just a single host. Applications that are running on clusters must set this value to 
Yes. The default is No.
Usage
CFAPPLICATION is typically used in the 
Application.cfm
 file to set defaults for a 
specific ColdFusion application.
CFAPPLICATION enables application variables unless they have been disabled in the 
ColdFusion Administrator. Using the SESSIONMANAGEMENT attribute to enable 
session variables is also overridden by the Administrator. See Administering 
ColdFusion Server 
for information about the ColdFusion Administrator. 
Server, Application, and Session Variables
Whenever you display, set, or update variables in the server, application, and session 
scopes, you should use the CFLOCK tag with the SCOPE attribute. For server variables, 
specify the "Server" scope. For application variables, specify the "Application" scope. 
For session variables, specify the "Session" scope. See 
CFLOCK
 for information about 
locking server, application, and session scopes.
If you are running ColdFusion on a cluster, you must specify either Cookie or a data 
source name for CLIENTSTORAGE; you cannot specify Registry.
Example
<!------------------------------------------------------------- 
    This example shows how CFLOCK can be used to guarantee the
    consistency of data updates to variables in the Application, 
Server, and Session scopes.
You should copy the following code into an Application.cfm
    file in the snippets directory. 
--------------------------------------------------------------->
<HTML>
<HEAD>
<title>Define Session and Application Variables</title>
</HEAD>
<BASEFONT FACE="Arial, Helvetica" SIZE=2>