我需要找出一种方法,唯一地识别每台计算机访问我正在创建的网站。有人有什么建议吗?

因为我想解决方案工作在所有机器和所有浏览器(在合理的范围内),我试图使用javascript创建一个解决方案。

饼干可不行。

我需要基本上创建一个guid的能力,这是唯一的计算机和可重复的,假设没有硬件变化发生在计算机上。我正在考虑的方向是获得网卡的MAC和这种性质的其他信息,这将id访问网站的机器。


当前回答

因为我想解决方案工作在所有机器和所有浏览器(在合理的范围内),我试图使用javascript创建一个解决方案。

这难道不是一个不使用javascript的好理由吗?

正如其他人所说,饼干可能是你最好的选择,但要知道它的局限性。

其他回答

我觉得饼干可能就是你要找的东西;这是大多数网站唯一识别访问者的方式。

假设您不希望用户拥有控制权,那么您就不能这样做。网络并不是这样工作的,你能期望的最好的是一些启发式。

如果你可以强迫访问者安装一些软件并使用TCPA,你可能会成功。

通过HTTP连接只能获得少量信息。

IP - But as others have said, this is not fixed for many, if not most Internet users due to their ISP's dynamic allocation policies. Useragent String - Nearly all browsers send what kind of browser they are with every request. However, this can be set by the user in many browsers today. Collection of request fields - There are other fields sent with each request, such as supported encodings, etc. These, if used in the aggregate can help to ID a user's machine, but again are browser dependent and can be changed. Cookies - Setting a cookie is another way to identify a machine, or more specifically a browser on a machine, but as others have said, these can be deleted, or turned off by the users, and are only applicable on a browser, not a machine.

So, the correct response is that you cannot achieve what you would live via the HTTP over IP protocols alone. However, using a combination of cookies, as well as IP, and the fields in the HTTP request, you have a good chance at guessing, sort of, what machine it is. Users tend to use only one browser, and often from one machine, so this may be fairly relieable, but this will vary depending on the audience...techies are more likely to mess with this stuff, and use more machines/browsers. Additionally, this could even be coupled with some attempt to geo-locate the IP, and use that data as well. But in any case, there is no solution that will be correct all of the time.

您可以使用fingerprintjs2

new Fingerprint2().get(function(result, components) {
  console.log(result) // a hash, representing your device fingerprint
  console.log(components) // an array of FP components
  //submit hash and JSON object to the server 
})

在此之后,您可以根据现有用户检查所有用户并检查JSON相似性,因此即使他们的指纹发生了突变,您仍然可以跟踪他们

如果没有用户的合作,识别访问网站的电脑是不可能的。但是,如果他们允许,您可以存储一个cookie,以便在机器再次访问您的网站时识别它。关键在于,访问者是可控的;他们可以删除cookie,并随时以新访客的身份出现。