user3245067
user3245067

Reputation: 195

Type of Request Web Client

As identified in C # where this is requested a specific web page, I wonder if the request comes from an image <img src="http://www.mydomain.com/default.aspx?n=123" /> or if the request is directly through an http browser, for example when the client is actually accessing the page via a browser sample: http://www.mydomain.com/default.aspx?n=123

Upvotes: 0

Views: 166

Answers (2)

Jim Mischel
Jim Mischel

Reputation: 134105

See Finding the referring url that brought a user to my site.

You'll probably get more answers if you tag your question with ASP.NET.

No, it's not completely reliable. HTTP is in large part a cooperative protocol. That is, there are fields there that browsers can use to identify themselves and tell you where they're coming from, but nothing forces them to do it. The sad truth, unbelievable as it may seem, is that people might lie to you. They might say they're viewing your image from your Web page, when they really aren't. Or their browser might not tell you that it's viewing the image from your Web page. In general, the UrlReferrer thing works, but it can be defeated. Just as the browser identification string can be spoofed. We do the best that we can, and call it good enough.

Upvotes: 1

rick schott
rick schott

Reputation: 21137

I would expect the Request.UrlReferrer to be null when the image src makes the request.

Upvotes: 0

Related Questions