ASP.NET - Response.Redirect Not Populating Url Referrer ASP.NET - Response.Redirect Not Populating Url Referrer asp.net asp.net

ASP.NET - Response.Redirect Not Populating Url Referrer


So, i've done some Google'ing to find my answer.

No thanks to Stack Overflow - kidding, =)

So the URL Referrer is only populated by an actual client-click (anchor tag, button).

Not when you manually put it in the URL (which is what my JavaScript is doing).

The solution i am doing to have to with is to create a cookie on the SingleSignOn.aspx page, and read that cookie from the JavaScript before i redirect again.

Just what i need, more cookies. =(

Unless someone here has a better idea, that's what ill be going with.


It's pretty late but as you manage response. redirect content, you could use query parameters as response.redirect("/?url=home.aspx&q=whatever").

Then you can capture it when page load or init and take the proper action about


Just a hunch, but try using an absolute url instead / including even the http:// part.

That said, you shouldn't rely on the UrlReferrer from being there, as it can be stripped off from the client side (by addins, not sure if even by some browser configs).