Getting A List Of Session Variables; Creating And Deleting Session Variables - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Variable
Session.URLToken
Session.SessionID
Note: ColdFusion lets you delete or change the values of the built-in session variables. As a general
rule, avoid doing so.
If you enable client variables and ColdFusion session management, ColdFusion uses the same
values for the Client and Session scope
the values for these variables from the same source, the client's
If you use J2EE session management, the Session scope does not include the
Session.CFToken
variables. In this case, the
consists of the string

Getting a list of session variables

Use the
StructKeyList
<cflock timeout=20 scope="Session" type="Readonly">
<cfoutput> #StructKeyList(Session)# </cfoutput>
</cflock>
Caution: Always put code that accesses session variables inside

Creating and deleting session variables

Use a standard assignment statement to create a new session variable, as follows:
<cflock timeout=20 scope="Session" type="Exclusive">
<cfset Session.ShoppingCartItems = 0>
</cflock>
Use the
structdelete
<cflock timeout=20 scope="Session" type="Exclusive">
<cfset StructDelete(Session, "ShoppingCartItems")>
</cflock>
Note: If you set session variables on a CFML template that uses the
might not set the variables. For more information, see Macromedia TechNote 22712 at
www.macromedia.com/v1/Handlers/index.cfm?ID=22712&Method=Full.
Description
ColdFusion session management: A combination of the
values in the form
CFToken
if the client does not support cookies and you must pass the
variables from page to page.
CFToken
J2EE session management: A combination of the
cookies and the J2EE session ID, in the form
CFID=IDNum&CFTOKEN=tokenNum&jsessionid=SessionID
A unique identifier for the session.
ColdFusion session management: a combination of the application name
and
and
CFID
CFToken
J2EE session management: the
CFID
variables, but does include the
Session.SessionID
followed by the J2EE session ID.
jsessionid=
function to get a list of session variables, as follows:
tag to delete a session variable; for example:
CFID=IDNum&CFTOKEN=tokenNum
values.
jsessionid
,
, and
CFToken
URLtoken
CFID
Session.URLToken
is the J2EE session ID and
cflock
cflocation
Configuring and using session variables
and
CFID
. Use this variable
and
CFID
and
CFID
CFToken
.
value.
variables. ColdFusion gets
and
cookies.
CFTOKEN
Session.CFID
and
Session.SessionID
Session.URLToken
tags.
tag, ColdFusion
or
329

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents