User Guide

Table Of Contents
Using ColdFusion security tags and functions 381
When ColdFusion maintains login information in the Session scope, it stores the authentication
details in a Session.cfauthorization variable, and ColdFusion uses the session cookie information
to identify the user. Session-based authentication has the following advantages over less persistent
login storage:
After the user logs in, the user ID and password are not passed between the server and
the browser.
The login information and the session share a single time-out. There is no need to manually
synchronize sessions and logins.
If you use server clusters, the Session scope login ID can be available across the cluster. For
more information on server clustering, see Configuring and Administering ColdFusion MX.
If you do not enable the Session scope, the authentication information is not kept in a persistent
scope. Instead, the detailed login information is put in a memory-only cookie
(CFAUTHORIZATION_applicationName) with a base64-encoded string that contains the user
name, password, and application name. The client sends this cookie to the web server each time it
makes a page request while the user is logged-in. Use SSL for all page transactions to protect the
user ID and password from unauthorized access.
Using ColdFusion security without cookies
You can implement a limited-lifetime form of ColdFusion security if the users browser does not
support cookies. In this case you do not use the
cflogin tag, only the cfloginuser tag. It is the
only time you should use the
cfloginuser tag outside a cflogin tag.
Without browser cookies, the effect of the
cfloginuser tag is limited to a single HTTP request.
You must provide your own authentication mechanism and call
cfloginuser on each page on
which you use ColdFusion login identification.
Using ColdFusion security tags and functions
ColdFusion provides the following tags and functions for user security:
Tag or function Purpose
cflogin A container for user authentication and login code. The body of the tag runs
only if the user is not logged in. When using application-based security, you
put code in the body of the
cflogin tag to check the user-provided ID and
password against a data source, LDAP directory, or other repository of login
identification. The body of the tag includes a
cfloginuser tag (or a ColdFusion
page that contains a
cfloginuser tag) to establish the authenticated user’s
identity in ColdFusion.
cfloginuser Identifies (logs in) a user to ColdFusion. Specifies the user’s ID, password, and
roles. This tag is typically used inside a
cflogin tag.
The
cfloginuser tag requires three attributes, name, password, and roles, and
does not have a body. The
roles attribute is a comma-delimited list of role
identifiers to which the logged-in user belongs. All spaces in the list are treated
as part of the role names, so you should not follow commas with spaces.
While the user is logged-in to ColdFusion, security functions can access the
user ID and role information.