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

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

饼干可不行。

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


当前回答

cookie对于确定唯一访问者没有用处。用户可以清除cookie并刷新网站,然后他将再次被归类为新用户。

我认为最好的方法是实现一个服务器端解决方案(因为您需要某个地方来存储数据)。根据您对此类数据需求的复杂程度,您将需要确定哪些是唯一访问。一个明智的方法是允许一个IP地址在第二天返回,并给予一个唯一的访问。同一IP地址在一天内的多次访问不应被视为唯一的。

例如,使用PHP,获取访问者的IP地址并将其存储在文本文件(或sql数据库)中是很简单的。

服务器端解决方案可以在所有机器上工作,因为您将在用户第一次加载您的网站时跟踪用户。不要使用javascript,因为这意味着客户端脚本,而且用户可能在任何情况下都禁用了它。

希望这能有所帮助。

其他回答

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

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

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

一种可能是使用flash cookie:

无处不在的可用性(95%的访问者可能会使用flash) 每个cookie可以存储更多数据(最多100 KB) 跨浏览器共享,因此更有可能唯一标识一台机器 清除浏览器cookie不会删除flash cookie。

你需要构建一个小的(隐藏的)flash电影来读写它们。

无论你选择哪种方式,确保你的用户选择被跟踪,否则你就侵犯了他们的隐私,成为坏人之一。

一个技巧:

Create 2 Registration Pages: First Registration Page: without any email or security check (just with username and password) Second Registration Page: with high security level (email verification request and security image and etc.) For customer satisfaction, and easy registration, default registration page should be the (First Registration Page) but in the (First Registration Page) there is a hidden restriction. It's IP Restriction. If an IP tried to register for second time, (for example less than 1 hour) instead of showing the block page. you can show the (Second Registration Page) automatically. in the (First Registration Page) you can set (for example: block 2 attempts from 1 ip for just 1 hour or 24 hours) and after (for example) 1 hour, you can open access from that ip automatically

请注意:(第一注册页)和(第二注册页)不应在分开的页面。你只写了一页。(例如:register.php),并在第一PHP样式和第二PHP样式之间切换

通过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.

你可能想尝试在evercookie中设置一个唯一的ID(它可以跨浏览器工作,见他们的常见问题): http://samy.pl/evercookie/

还有一家叫做ThreatMetrix的公司,被很多大公司用来解决这个问题: http://threatmetrix.com/our-solutions/solutions-by-product/trustdefender-id/ 它们相当昂贵,而且他们的其他一些产品也不太好,但他们的设备id运行良好。

最后,还有这个开源jquery实现的panopticlick的想法: https://github.com/carlo/jquery-browser-fingerprint 它现在看起来很不成熟,但可以扩展。

希望能有所帮助!