User Guide

Table Of Contents
350 Chapter 15: Using Persistent Data and Locking
Standard client variables
The Client scope has the following built-in, read-only variables that your application can use:
Note: ColdFusion lets you delete or change the values of the built-in client variables. As a general
rule, avoid doing so.
You use the Client.CFID, Client.CFToken, and Client.URLToken variables if your application
supports browsers that do not allow cookies. For more information on supporting browsers that
do not allow cookies, see “Using client and session variables without cookies” on page 344.
You can use the
Client.HitCount and time information variables to customize behavior that
depends on how often users visit your site and when they last visited. For example, the following
code shows the date of a user's last visit to your site:
<cfoutput>
Welcome back to the Web SuperShop. Your last
visit was on #DateFormat(Client.LastVisit)#.
</cfoutput>
Getting a list of client variables
To obtain a list of the custom client parameters associated with a particular client, use the
GetClientVariablesList function, as follows:
<cfoutput>#GetClientVariablesList()#</cfoutput>
The GetClientVariablesList function returns a comma-separated list of the names of the
client variables for the current application. The standard system-provided client variables (
CFID,
CFToken, URLToken, HitCount, TimeCreated, and LastVisit) are not returned in the list.
Variable Description
Client.CFID The client ID, normally stored on the client system as a cookie.
Client.CFToken The client security token, normally stored on the client system as a cookie.
Client.URLToken Value depends on whether J2EE session management is enabled.
No session management or ColdFusion session management: A
combination of the
CFID and CFToken values, in the form
CFID=IDNum&CFTOKEN=tokenNum. This variable is useful if the client does not
support cookies and you must pass the
CFID and CFToken variables from
page to page.
J2EE session management: A combination of
CFID, CFToken, and
session ID values in the form
CFID=IDNum&CFTOKEN=tokenNum&jsessionid=SessionID.
Client.HitCount The number of page requests made by the client.
Client.LastVisit The last time the client visited the application.
Client.TimeCreated The time the
CFID and CFToken variables that identify the client to
ColdFusion were first created.