PHP 唯一计算机 ID
php(或者在最坏的情况下是javascript)是否可以为不依赖cookie或ip的用户创建一个唯一的id。我在 myminicity.com 上看到,每个城市的计数每天只增加一次(它有一个唯一的 id)对于我认为的每个人来说),即使我删除了 cookie 并刷新 ip,它似乎仍然检测到我已经被访问过,我想为我制作这个系统。我看到很多人说这是不可能的,如果真的不可能,最好的选择是什么?
编辑
现在我想到我可以混合使用多个cookie(具有多种识别方法)、多个本地存储值(与cookie相同)、mysql数据库ip跟踪和flash cookies以及如果有的话找到其中之一,该用户在今天之前访问过。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
用户代理向服务器发送多种信息。请参阅 Panopticlick 示例,了解您的浏览器有多独特。另一种选择是使用更难拒绝和删除的Flash cookies。
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.
您可以为每台计算机生成一个 GUID,假设您可以找到某种方法来存储它,以便用户无法删除它(祝您好运)。
大多数执行此类操作的网站都会将 IP 地址存储在服务器上的数据库中,并以这种方式识别“用户”。使用 javascript,您可以组合 IP 地址和 MAC 地址,以允许 NAT 网关后面的多人使用。
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 使用您的 IP 范围来检测您来自哪个区域...这称为 IP 基础地理定位。为此有免费和付费服务。 Google“基于 IP 的地理定位”...您可以在 http://en.wikipedia 中了解更多信息。 org/wiki/Geolocation_software
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
某些
$_SERVER
变量可用于生成计算机 ID。例如:$_SERVER
的值可以伪造,但它仍然会增加一层不依赖于 cookie 或您的 IP 地址的额外安全层。Some of the
$_SERVER
variables can be used to generate a computer ID. For example: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.