location
Stops execution of the current page and redirects to the given URL.
location(url [, addtoken] [, statuscode]) → returns void
Argument Reference
url string Required
URL of web page to open.
addtoken boolean
Default: true
true
clientManagement must be enabled (see cfapplication).
statuscode numeric
Default: 302
302
The HTTP status code
Values:
300301302303304305306307
Compatibility
ColdFusion:
Version 9+ Implemented as both a function and an alias to the cflocation tag in script, so named parameters can be used prior to CF2018+. CF11+
addtoken default value is false when Secure Profile is enabled Examples Sample code invoking the location function
Relocates to a different page if user is not logged in.
if (!structKeyExists(session, "userID") {
location("login.cfm");
}
© 2012–present Foundeo, Inc. and the CFDocs contributors.
Licensed under the MIT License.
ColdFusion is a trademark of Adobe Systems Incorporated.
https://cfdocs.org/location