User Guide

Table Of Contents
Using an Application.cfm page 295
Put in the onSessionStart method any code that initializes Session scope variables, and any
other application-specific code that executes only when the session starts. Remove any code
that tests for the existence of Session scope variables to be for initialized and the Session scope
lock that surrounds the code that sets the Session scope variables.
Put in the onRequestStart method any cflogin tag and related authentication code.
Put in the onRequest method any code that sets Variables scope variables and add a
cfinclude tag that includes the page specified by the methods Arguments.Targetpage
variable.
Put in the onRequestEnd method any code you have in an OnRequestEnd.cfm page.
Consider replacing cferror tags with an onError event method. If you do not do so, put the
cferror tags in the CFC initialization code.
Using an Application.cfm page
If you do not use an Application.cfc file, you can use the Application.cfm page to define
application-level settings and functions, as described in the following sections.
Naming the application
Use the
cfapplication tag to specify the application name and define a set of pages as part of
the same logical application. Although you can create an application by putting a
cfapplication
tag with the application name on each page, you normally put the tag in the Application.cfm file;
for example:
<cfapplication name="SearchApp">
Note: The value that you set for the name attribute in the cfapplication tag is limited to 64
characters.
Setting the client, application, and session variables options
Use the
cfapplication tag to specify client state and persistent variable use, as follows:
To use Client scope variables, you must specify clientManagement=True.
To use Session scope variables, you must specify sessionManagment=True.
You can also optionally do the following:
Set application-specific time-outs for Application and Session scope variables. These settings
override the default values set in the ColdFusion MX Administrator.
Specify a storage method for Client scope variables. This setting overrides the method set in
the ColdFusion MX Administrator.
Specify not to use cookies on the client browser.
For more information on configuring these options, see Chapter 15, “Using Persistent Data and
Locking,” on page 339, and CFML Reference.