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
URLattribute. In order to use theaddtokenattribute,clientmanagementmust be turned on in the Application.cfm file. Optional. The default isYes.