nebkat
nebkat

Reputation: 8565

PHP Unique Computer ID

Is it possible for php(or javascript in the worst case) to create a unique id for a user that is not cookie or ip dependant. I have seen on myminicity.com that on each city the count only goes up once a day(it has a unique id for everyone i think) and even if I delete my cookies and refresh ip it still seems to detect me as visited already and I want to make this system for me. I have seen lots of people saying its not possible and if it really isn't, whats the best alternative?

EDIT

Now i got the idea that I could use a mix of multiple cookies(with multiple methods of identification), multiple localstorage values(same as the cookies), mysql database ip tracking and flash cookies and if any one of them is found, the user has visited before today.

Upvotes: 4

Views: 5480

Answers (4)

Dan Bray
Dan Bray

Reputation: 7822

Some of the $_SERVER variables can be used to generate a computer ID. For example:

$id = $_SERVER['HTTP_USER_AGENT'].$_SERVER['LOCAL_ADDR'].$_SERVER['LOCAL_PORT'].$_SERVER['REMOTE_ADDR'];

The values of $_SERVER can be faked, however it will still add an extra layer of security that does not rely on cookies or your IP address.

Upvotes: 0

Gumbo
Gumbo

Reputation: 655169

There are several information a user agent sends to the server. See for example Panopticlick to see how unique your browser is. Another option would be to use Flash cookies that are harder to reject and delete.

Upvotes: 5

Elf King
Elf King

Reputation: 1183

myminicity.com uses your IP range to detect which region you are coming in from... It is called IP base geolocation. There are free and paid services for this. Google "IP based geolocation" ... You can learn more about it at http://en.wikipedia.org/wiki/Geolocation_software

Upvotes: 1

Donnie
Donnie

Reputation: 46903

You could generate a GUID per computer, assuming that you can figure out some way to store it such that the user can't delete it (good luck).

Most sites that do things like this store the IP address in a database on the server and identify "users" that way. Using javascript you can combine IP address and MAC address to allow for multiple people behind a NAT gateway.

Upvotes: 1

Related Questions