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">

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.

Get Programming ColdFusion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.