0

we can use Request.UserHostAddress to catch referrer IP address(for example who clicked a link) but you know by this way we can't ensure about uniqueness of user! this ip don't work correctly in NAT environment because it might be refer to hundreds of machines.
i'm looking for a posible way to detect really how many peoples clicked a specify link.
i think UserHostAddress can't help me.

so, is there any way to fetch some data from user's OS or browser which is unique?
(consider that that link is not in my own application. it is in a remote page)

Mehdi
  • 5,435
  • 6
  • 37
  • 57
  • 1
    Request.UserHostAddress is working correctly - as has been pointed out on your previous question: http://stackoverflow.com/questions/735350/how-to-get-user-client-ip-address-in-asp-net If it was sending you the IP Address of the machine behind the NAT, all you'd see would be an awful lot of computers with IP Addresses ranging from 192.168.0.0 to 192.168.255.255, and no idea at all about uniqueness beyond that. – Zhaph - Ben Duguid Apr 25 '09 at 14:58

3 Answers3

3

The answer from Grzenio is correct; I'll just elaborate a bit. The only way to make sure that the client sends you something unique is for you to have sent it to the client first, and for you to have made sure it is unique. Creating a GUID and setting it in a cookie is one way to do it. If you care about spoofing, then encrypt the GUID first.

Clients aren't obligated to have something unique about them, and IP addresses were explicitly designed to not identify a client computer.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
1

If this link is from the web page you own, you can set a unique cookie on the parent page.

Grzenio
  • 35,875
  • 47
  • 158
  • 240
1

Without being able to set cookies, there is no guarantee that you'll be able to tell users apart. Google Analytics and all of the other web analytic programs use either IP, cookies, or UserID to differentiate the users.

David
  • 34,223
  • 3
  • 62
  • 80