Adobe COLDFUSION 9 Manual page 319

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Variable
Session.CFID
Session.CFToken
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
,
CFID
CFToken
source, the client's
and
CFID
If you use J2EE session management, the Session scope does not include the
variables, but does include the
is the J2EE session ID and
Session.SessionID
the J2EE session ID.
Getting a list of session variables
Use the
function to get a list of session variables, as follows:
StructKeyList
<cflock timeout=20 scope="Session" type="Readonly">
<cfoutput> #StructKeyList(Session)# </cfoutput>
</cflock>
Important: 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
tag to delete a session variable; for example:
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
variables. For more information, see TechNote at www.adobe.com/go/tn_18171.
Accessing and changing session variables
You use the same syntax to access a session variable as for other types of variables. However, lock any code that accesses
or changes session variables.
Description
ColdFusion session management only: the client ID, normally stored on the client system as a cookie.
ColdFusion session management only: the client security token, normally stored on the client system as a
cookie.
ColdFusion session management: A combination of the
IDNum
tokenNum. Use this variable if the client does not support cookies and you must
CFID=
&CFTOKEN=
pass the
and
variables from page to page.
CFID
CFToken
J2EE session management: A combination of the
the form
IDNum
CFID=
&CFTOKEN=
A unique identifier for the session.
ColdFusion session management: a combination of the application name and
J2EE session management: the
jsessionid
, and
variables. ColdFusion gets the values for these variables from the same
URLtoken
cookies.
CFTOKEN
and
Session.URLToken
Session.SessionID
Session.URLToken
Last updated 8/5/2010
and
CFID
CFToken
and
CFID
CFToken
tokenNum
SessionID.
&jsessionid=
value.
Session.CFID
variables. In this case, the
consists of the string
tags.
cflock
tag, ColdFusion might not set the
cflocation
values in the form
cookies and the J2EE session ID, in
and
values.
CFID
CFToken
or
Session.CFToken
followed by
jsessionid=
314

Advertisement

Table of Contents
loading

Table of Contents