ColdFusion CFLocation Only Passes Referrer Of The Referring URL

<!--- Kill extra output. --->
<cfsilent>
 
	<!--- Param URL variables. --->
	<cfparam
		name="URL.cflocation"
		type="string"
		default="No"
		/>
 
	<cfparam
		name="URL.relocate"
		type="boolean"
		default="false"
		/>
 
 
	<!---
		Check to see if a CFLocaiton call has been requested.
		If so, we are just going to CFLocate back to self.
		This will allow us to see what the referrer is seen
		as by the target page.
	--->
	<cfif URL.relocate>
 
		<cflocation
			url="#CGI.script_name#?cflocation=Yes"
			addtoken="false"
			/>
 
	</cfif>
 
</cfsilent>
 
<cfoutput>
 
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html>
	<head>
		<title>ColdFusion CFLocation And HTTP Referer</title>
	</head>
	<body>
 
		<p>
			CFLocation: #URL.cflocation#<br />
			Referrer: #ListFirst(
				ListLast( CGI.http_referer, "\/" ),
				"?"
				)#
		</p>
 
		<p>
			<a
				href="#CGI.script_name#"
				>Refresh</a>
 
			&nbsp;|&nbsp;
 
			<a
				href="#CGI.script_name#?relocate=true"
				>Refresh With CFLocation</a>
		</p>
 
	</body>
	</html>
 
</cfoutput>

For Cut-and-Paste