Tuesday, March 13, 2012

HTTP REFERER null in C#

I am trying using http referer in C# to detect another website that calls my site.

Trying but it's not working, try googling, but they all suggest using all these:

- Request.UrlReferrer
- HttpContext.Current.Request.ServerVariables["HTTP_REFERER"]

but still resulting in null.

ask my friend to try, and he succeeded.

try to check the difference in the code, and finally... got the problem...

It's not working when redirect from PAGE_LOAD because I think on page load the header is not loaded yet, so if you directly redirect the page, it will contain NULL.
He's using a button to redirect, no wonder it's working, lol

Update (20120412):
It is also not working from HTTPS to HTTP site :)

dang! a big problem for me..

0 comments:

Post a Comment