Domanda

I've done some reading on User-agent attributes and even client-side exploits to recover user information.

I want to know if it is possible to legally identify a web client running on a specific computer (not smart phone) as a unique device using the currently available web browsers.

È stato utile?

Soluzione

I'd use cookies personally, but if you want to give a computer/browser an ID:

$id = md5($_SERVER['REMOTE_ADDR'].$_SERVER['USER_AGENT']);

This will create a unique md5 sum based off the IP address and user agent, so even using a different browser on the same machine will give you a different ID. You could use this ID to store information in a database or file.

The question doesn't specify a language so I've used PHP for my example, but the principle is the same as with other languages anyway.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top