Skip to Main Content
Programming ColdFusion MX, 2nd Edition
book

Programming ColdFusion MX, 2nd Edition

by Rob Brooks-Bilson
August 2003
Intermediate to advanced content levelIntermediate to advanced
1140 pages
68h 45m
English
O'Reilly Media, Inc.
Content preview from Programming ColdFusion MX, 2nd Edition

Name

cflocation

Synopsis

<cflocation>

Redirects the user’s browser to a new location. Due to the way ColdFusion assembles dynamic pages, you shouldn’t attempt to use the cflocation tag within a template after a cookie variable has been set. Setting a cookie variable and using cflocation afterward results in the cookie not being set. If you need to redirect to a different template after setting a cookie, consider using the cfheader tag instead, as in:

<cfcookie name="MyCookie" value="Hey, look at me!">
<cfheader name="Refresh" value="0; URL=http://www.example.com/mytemplate.cfm">

Or:

<cfheader name="Location" value="mytemplate.cfm">
<cfheader statuscode="302" statustext="Document Moved">

Attributes

URL=" URL "

The URL to redirect the user’s browser to. Required.

addtoken="Yes|No"

Whether or not to append client variable information to the end of the URL specified in the URL attribute. In order to use the addtoken attribute, clientmanagement must be turned on in the Application.cfm file. Optional. The default is Yes.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming ColdFusion

Programming ColdFusion

Rob Brooks-Bilson

Publisher Resources

ISBN: 0596003803Supplemental ContentErrata Page