In my own case if you use "cgi.query_string" it will fail since
the srings passed are "UrlToken" thus it would have been:
<cfoutput>#ReplaceNoCase(cgi.http_referer,"?#urltoken#","")#</cfoutput>
and this would have worked. But what if it were a "query_string"
then it will fail. So SpanExcluding is a better option.
Now, you've lost me. I don't understand the distinction you
make here. Any code that deletes the string "?#cgi.query_string#"
from a URL will also delete "?#session.urltoken#" from it. In
general, the string session.URLToken is contained in the string
cgi.query_string, not the other way round, as you seem to suggest.
That said, there are of course at least a dozen possible ways
to do it. The choice is yours.