开发者

PHP Unique Computer ID

开发者 https://www.devze.com 2023-01-07 08:59 出处:网络
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 eac开发者_开发问答h city the count on

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 eac开发者_开发问答h 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.


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.


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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号