About persistent scope variables
ColdFusion MX provides four variable scopes, described in the following table, that let you
maintain data that must be available to multiple applications or users or must last beyond the
scope of the current request.
Variable scope
Client
Session
Application
Server
The following sections provide information that is common to all or several of these variables.
Later sections describe how to use the Client, Session, Application, and Server scopes in your
applications, and provide detailed information about locking code.
ColdFusion persistent variables and ColdFusion structures
All persistent scopes are available as ColdFusion structures. As a result, you can use ColdFusion
structure functions to access and manipulate Client, Session, Application, and Server scope
contents. This chapter does not cover using these functions in detail, but does mention features or
limitations that apply to specific scopes.
316
Chapter 15: Using Persistent Data and Locking
Description
Contains variables that are available for a single client browser over multiple
browser sessions in an application. For information about browser sessions, see,
"What is a session?" on page
Useful for client-specific information, such as client preferences, that you want to
store for a significant period of time.
Data is stored as cookies, database entries, or Registry values. Client variables
can time out after an extended period.
Although do not have to use the Client scope prefix in the variable name, code
that uses the prefix is more efficient and easier to maintain.
Contains variables that are available for a single client browser for a single
browser session in an application.
Useful for client-specific information, such as shopping cart contents, that you
want to persist while the client is visiting your application.
Data is stored in memory and times out after a period of inactivity or when the
server shuts down.
ColdFusion MX Administrator lets you select between two kinds of session
management, Standard ColdFusion Session management and J2EE session
management. For information about types of session management, see,
"ColdFusion and J2EE session management" on page 327
You must use the Session scope prefix in the variable name.
Contains variables that are available to all pages in an application for all clients.
Useful for application-specific information, such as contact information, that can
vary over time and should be stored in a variable.
Data is stored in memory and times out after a period of inactivity or when the
server shuts down.
You must use the Application scope prefix in the variable name.
Contains variables that are available to all applications in a server and all clients.
Useful for information that applies to all pages on the server, such as an
aggregate page-hit counter.
Data is stored in memory. The variables do not time out, but you can delete
variables you create, and all server variables are automatically deleted when the
server stops running.
You must use the Server scope prefix in the variable name.
326.
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers