Getting A List Of Session Variables; Using Application Variables; Storing Application Data In Application Variables - MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual

Table of Contents

Advertisement

230

Getting a list of Session variables

The variable Session scope is registered as a ColdFusion structure. This lets you use
the ColdFusion Structure functions to get a list of Session variables. For example, you
can use
defined for a specific application.
To find a list of Client variables, you use the
For more information on these functions, see the CFML Reference.

Using Application Variables

Application variables are available to all pages within an application, that is, pages
that have the same application name. Because they are persistent, you can pass
values between pages with a minimum of effort.
You set the application name in the
application's Application.cfm page. The name you establish in the
tag is accessible elsewhere in the application by using the
Application.ApplicationName
cflock
Unlike Client and Session variables, Application variables do not require that a client
name (client ID) is associated with them. Thus, they are available to any clients that
specify the same application name. Also, you do not need to use the
tag to enable Application variables. Using the ColdFusion Administrator you can
enable or disable Application variables in all applications; you cannot override this
setting for an individual application.
Like Session variables, ColdFusion stores Application variables in the ColdFusion
Server's memory and you can set timeout values for these variables either with
cfapplication
For information on setting timeouts for variables, see Advanced ColdFusion
Administration.

Storing application data in Application variables

Application variables are designed to store application-level data. They are a
convenient place to store information that all pages of your application might need
no matter which client is running that application. Using Application variables, an
application could initialize itself, say, when the first user access any page of that
application. This information can then remain available indefinitely to all
subsequent hits of any pages of that application, by all users, thereby avoiding the
overhead of repeated initialization.
Because the data stored in Application variables is available to all pages of an
application and remains available until either a specific period of inactivity passes or
the ColdFusion Server shuts down, Application variables are very convenient.
However, because all clients running an application see the same set of Application
with the
cfloop
StructFind
tag to restrict access to Application variables to one request at a time.
, or by specifying timeouts in the ColdFusion Administrator.
Chapter 12 Using the Application Framework
function to output a list of Session variables
GetClientVariablesList
tag, normally on your
cfapplication
variable. For example, you use this variable in the
function.
cfapplication
cfapplication

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents