You can specify application properties by setting This scope variables in the Application.cfc initialization code. (These are the same properties that you can set in the cfapplication
tag.) The following table lists the This scope variables that ColdFusion MX uses to set application properties and describes their uses.
Variable | Default | Description |
---|---|---|
applicationTimeout |
Administrator value |
Life span, as a real number of days, of the application, including all Application scope variables. Use the |
clientManagement |
False |
Whether the application supports Client scope variables. |
clientStorage |
Administrator value |
Where Client variables are stored; can be cookie, registry, or the name of a data source. |
loginStorage |
Cookie |
Whether to store login information in the Cookie scope or the Session scope. |
scriptProtect |
Administrator Value |
Whether to protect variables from cross-site scripting attacks. |
sessionManagement |
False |
Whether the application supports Session scope variables. |
sessionTimeout |
Administrator Value |
Life span, as a real number of days, of the user session, including all Session variables. Use the |
setClientCookies |
True |
Whether to send CFID and CFTOKEN cookies to the client browser. |
setDomainCookies |
False |
Whether to use domain cookies for the CFID and CFTOKEN values used for client identification, and for Client scope variables stored using cookies. If False, ColdFusion MX uses host-specific cookies. Set to True for applications running on clusters. |
The following example code from the top of an Application.cfc sets the application name and properties:
<cfcomponent> <cfset This.name = "TestApplication"> <cfset This.clientmanagement="True"> <cfset This.loginstorage="Session"> <cfset This.sessionmanagement="True"> <cfset This.sessiontimeout="#createtimespan(0,0,10,0)#"> <cfset This.applicationtimeout="#createtimespan(5,0,0,0)#">
For more information on these settings, see cfapplication
in CFML Reference.