简体   繁体   English

PHP唯一计算机ID

[英]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. php(或最坏情况下的javascript)是否可以为不依赖Cookie或ip的用户创建唯一的ID。 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. 我在myminicity.com上看到,每个城市的计数每天只会增加一次(它对我认为的每个人都有一个唯一的ID),即使我删除Cookie并刷新ip,它似乎仍然可以检测到我已经访问过,并且我想为我制作这个系统。 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. 现在我有了一个想法,我可以混合使用多个cookie(具有多种标识方法),多个localstorage值(与cookie相同),mysql数据库ip跟踪和flash cookie,如果找到其中任何一个,则该用户今天之前去过。

There are several information a user agent sends to the server. 用户代理发送到服务器的信息有很多。 See for example Panopticlick to see how unique your browser is. 例如,请参见Panopticlick,以查看您的浏览器的独特性。 Another option would be to use Flash cookies that are harder to reject and delete. 另一种选择是使用难以拒绝和删除的Flash cookie

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). 您可以为每台计算机生成一个GUID,假设您可以找到一种存储它的方式,以便用户无法删除它(祝您好运)。

Most sites that do things like this store the IP address in a database on the server and identify "users" that way. 大多数执行此类操作的站点会将IP地址存储在服务器上的数据库中,并以此方式标识“用户”。 Using javascript you can combine IP address and MAC address to allow for multiple people behind a NAT gateway. 使用javascript,您可以组合IP地址和MAC地址,以允许NAT网关后面的多个人员。

myminicity.com uses your IP range to detect which region you are coming in from... It is called IP base geolocation. myminicity.com使用您的IP范围来检测您来自哪个区域。这称为IP基础地理位置。 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 Google“基于IP的地理位置” ...您可以在http://en.wikipedia.org/wiki/Geolocation_software上了解更多信息

Some of the $_SERVER variables can be used to generate a computer ID. 某些$_SERVER变量可用于生成计算机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. $_SERVER的值可以伪造,但是仍会增加一层不依赖Cookie或IP地址的安全性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM