How to fix problems with asp.net, C# and Request.ServerVariables["HTTP_REFERER"] « Digital Tool Factory blog

How to fix problems with asp.net, C# and Request.ServerVariables["HTTP_REFERER"]

The Problem: I recently built a small web app that tracked downloads.   Part of that was using the referring page.  Somehow, for some reason, the url was not being sent along with the request.

The Cause: After much travail, I finally noticed that the browser was on page https://www.somedomain.com and the link in question was http://somedomain.com/mytrackingapp – i.e. not under SSL, and with a slightly different hostname.  For some reason the referer header is not sent in that situation.

The Solution: Just change the link to https://www.somedomain.com/mytrackingapp and life is good.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog

 

Written By Steve French

 

Leave a Reply





Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.