
Configuring and using client variables
321
Providing Session security
ColdFusion uses the same client identifiers for the Client scope and the standard Session scope.
Because the
CFToken
and
CFID
values are used to identify a client over a period of time, they are
normally saved as cookies on the user’s browser. These cookies persist until the client’s browser
deletes them, which can be a considerable length of time. As a result, hackers could have more
access to these variables than if ColdFusion used different user identifiers for each session.
A hacker who has the user’s
CFToken
and
CFID
cookies could gain access to user data by accessing
a web page during the user’s session using the stolen
CFToken
and
CFID
cookies. While this
scenario is unlikely, it is theoretically possible.
You can remove this vulnerability by selecting the Use J2EE Session Variables option on the
ColdFusion MX Administrator Memory Variables page. The J2EE session management
mechanism creates a new session identifier for each session, and does not use either the
CFToken
or the
CFID
cookie value.
Managing client identity information in a clustered environment
To maintain your application’s client identity information in a clustered server environment, you
must specify the
cfapplication
setdomaincookies
attribute in your Application.cfm page.
The
setdomaincookies
attribute specifies that the server-side copies of the
CFID
and
CFToken
variables used to identify the client to ColdFusion are stored at the domain level (for example,
.macromedia.com). If
CFID
and
CFToken
variable combinations already exist on each host in the
cluster, ColdFusion migrates the host-level variables on each cluster member to the single,
common domain-level variable. Following the setting or migration of host-level cookie variables
to domain-level variables, ColdFusion creates a new cookie variable (
CFMagic
) that tells
ColdFusion that domain-level cookies have been set.
If you use client variables in a clustered system, you must also use a database or cookies to store
the variables.
Configuring and using client variables
Use client variables for data that is associated with a particular client and application and that
must be saved between user sessions. Use client variables for long-term information such as user
display or content preferences.
Enabling client variables
To enable client variables, you must set the
cfapplication
tag
clientmanagement
attribute to
Yes on every page. Because the Application.cfm file is included in all of the application’s pages,
you enable client management in the
cfapplication
tag, at the beginning of the
Application.cfm file. For example, to enable client variables in an application named SearchApp,
you use the following line in the application’s Application.cfm page:
<cfapplication NAME="SearchApp" clientmanagement="Yes">
Choosing a client variable storage method
By default, Coldfusion stores client variables in the Registry. In most cases, however, it is more
appropriate to store the information as client cookies or in a SQL database.
Summary of Contents for ColdFusion MX
Page 1: ...Developing ColdFusion MX Applications...
Page 22: ...22 Contents...
Page 38: ......
Page 52: ...52 Chapter 2 Elements of CFML...
Page 162: ......
Page 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Page 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Page 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Page 266: ......
Page 314: ...314 Chapter 14 Handling Errors...
Page 344: ...344 Chapter 15 Using Persistent Data and Locking...
Page 349: ...About user security 349...
Page 357: ...Security scenarios 357...
Page 370: ...370 Chapter 16 Securing Applications...
Page 388: ...388 Chapter 17 Developing Globalized Applications...
Page 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Page 410: ......
Page 426: ...426 Chapter 19 Introduction to Databases and SQL...
Page 476: ...476 Chapter 22 Using Query of Queries...
Page 534: ...534 Chapter 24 Building a Search Interface...
Page 556: ...556 Chapter 25 Using Verity Search Expressions...
Page 558: ......
Page 582: ...582 Chapter 26 Retrieving and Formatting Data...
Page 668: ......
Page 734: ...734 Chapter 32 Using Web Services...
Page 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Page 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Page 788: ......