When to use Request.UrlReferrer and when Request.ServerVariables["HTTP_REFERER"]?
Both returns the incoming url, Just to know When to use开发者_高级运维 Request.UrlReferrer
and when Request.ServerVariables["HTTP_REFERER"]
and why?
Currently, in one of my application Urlreferrer is working in my local machine but its not working when went live?
Additionally, its most appreciable if anyone can guide any alternative of both Urlreferrer and HTTP_REFERRER?
Answering to last question. Request.UrlReferrer returns an Uri object, so if UrlReferrer has bad format then you get an exception. It seems strange, but some times I have got it. HTTP_REFERER is a string.
Does the Request.ServerVariables[]
work in the live situation? It is my understanding that the two are identical.
Can it be that proxies and/or firewalls (at the server, the client or anywhere inbetween as an ISP) are stripping the referrer?
精彩评论