Skip to main content
Inspiring
April 21, 2006
Answered

Post with No URLSessionFormat

  • April 21, 2006
  • 6 replies
  • 543 views
Is there a way you could post form and strip out all the URLSessionFormat eg
check the HTTP_REFERER without the URLSessionFormat like CFID=16539&CFTOKEN=88882009&jsessionid=64301634311145628979265
This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer umuayo
Thanks BKBK for your reply, but that did not do. What I did to strip out the URLTOKEN is this
#SpanExcluding(http_referer,"?")#

6 replies

BKBK
Community Expert
Community Expert
April 25, 2006
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.

Inspiring
April 25, 2006
But SpanExcluding strips out the entire query string too?

This regex should remove the three attributes and their values, but leave the rest of the query string intact:
REReplaceNoCase(http_referer,"&?(cfid|cftoken|jsessionid)=[^&]+","","all")
BKBK
Community Expert
Community Expert
April 24, 2006
> that did not do
Try it.

<cfoutput>#ReplaceNoCase(cgi.http_referer,"?#cgi.query_string#","")#</cfoutput>

will output the referrer without query-string attached, assuming there is a referrer, of course.

umuayoAuthor
Inspiring
April 25, 2006
BKBK,
The safest way I think this wiil be done is to use the "SpanExcluding". 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.

Thanks for all your help.
BKBK
Community Expert
Community Expert
April 23, 2006
referrer without query-string:
<cfoutput>#ReplaceNoCase(cgi.http_referer,"?#cgi.query_string#","")#</cfoutput>




umuayoAuthorCorrect answer
Inspiring
April 24, 2006
Thanks BKBK for your reply, but that did not do. What I did to strip out the URLTOKEN is this
#SpanExcluding(http_referer,"?")#