Using Session Variables
229
The default timeout for Session variables is set to 20 minutes. You can change the
timeout on the Memory Variables page of the ColdFusion Administrator Server tab.
For more information, see Advanced ColdFusion Administration.
You can also set the timeout period for Session variables inside a specific application
(thereby overruling the Administrator default setting) by using the
cfapplication
tag
sessionTimeout
attribute.
Storing session data in Session variables
Session variables are designed to store session-level data. They are a convenient
place to store information that all pages of your application might need during a user
session. Using Session variables, an application can initialize itself with user-specific
data the first time a user accesses one of the application’s pages. This information
can remain available while that user continues to use that application. For example,
you can retrieve information about a specific user’s preferences from a database
once, the first time a user accesses any page of an application. This information
remains available throughout that user’s session, thereby avoiding the overhead of
retrieving the preferences again and again.
Like Client variables, Session variables require a client name (client ID) and are
always scoped within that client ID. Session variables also work within the scope of
an application name if one is supplied, in which case their scope is the combination
of the client ID and the application name.
Standard Session variables
The Session Client scope has four built-in, read-only variables that your application
can use:
If you are also using Client variables, the
Session
.CFID,
Session.CFToken
, and
Session.URL
token
are identical to the corresponding Client variables.
Variable
Description
Session.CFID
The client ID, normally stored on the client system as a
cookie.
Session.CFToken
The client security token, normally stored on the client system
as a cookie.
Session.URLToken
A combination of the CFID and CFToken in the form
CFID=
IDNum
&CFTOKEN=
tokenNum
. Use this variable if the client
does not support cookies and you must pass the
CFID
and
CFToken
variables from page to page.
Session.SessionID
A unique identifier for the session. You use this variable in
cflock
tags to identify the scope of the lock.
Summary of Contents for COLDFUSION 5-DEVELOPING
Page 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Page 58: ...38 Chapter 3 Querying a Database ...
Page 134: ...114 Chapter 7 Updating Your Database ...
Page 210: ...190 Chapter 10 Reusing Code ...
Page 232: ...212 Chapter 11 Preventing and Handling Errors ...
Page 238: ...218 Chapter 12 Using the Application Framework ...
Page 262: ...242 Chapter 12 Using the Application Framework ...
Page 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Page 320: ...300 Chapter 15 Indexing and Searching Data ...
Page 336: ...316 Chapter 16 Sending and Receiving E mail ...
Page 374: ...354 Chapter 18 Interacting with Remote Servers ...