PHP 唯一计算机 ID

发布于 2024-09-10 04:15:32 字数 405 浏览 4 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

昵称有卵用 2024-09-17 04:15:32

用户代理向服务器发送多种信息。请参阅 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.

南城追梦 2024-09-17 04:15:32

您可以为每台计算机生成一个 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.

野心澎湃 2024-09-17 04:15:32

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

一江春梦 2024-09-17 04:15:32

某些 $_SERVER 变量可用于生成计算机 ID。例如:

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

$_SERVER 的值可以伪造,但它仍然会增加一层不依赖于 cookie 或您的 IP 地址的额外安全层。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文