Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use Request.UrlReferrer and when Request.ServerVariables["HTTP_REFERER"]?

Tags:

c#

asp.net

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?

like image 971
Gaurav Arora Avatar asked Aug 25 '10 11:08

Gaurav Arora


1 Answers

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.

like image 179
fravelgue Avatar answered Nov 10 '22 00:11

fravelgue