如何识别我的网站上没有Cookie的特定计算机(就像Twitter一样)? [英] How can I identify a particular computer on my website without cookies (just like Twitter does)?

查看:200
本文介绍了如何识别我的网站上没有Cookie的特定计算机(就像Twitter一样)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我知道这可以做,因为Twitter可以做到。以下是证明:


  1. 重置浏览器(无Cookie,无缓存,完全重置)

  2. twitter.com

  3. 请注意新添加的 _twitter_sess cookie的价值

  4. Cookie _twitter_sess 将具有与之前相同的值

  5. 更改IP地址 b $ b
  6. 重复步骤1 - 3. Cookie _twitter_sess 将具有与之前相同的值


  7. 重复步骤1 - 3. Cookie _twitter_sess 将具有与之前相同的值

  8. 更改用户代理

  9. 重复步骤1 - 3. Cookie _twitter_sess code>将 最终 不同

一样?

解决方案

听起来像Twitter从浏览器请求头中检查IP地址,因此您需要在请求时在服务器端实现类似的功能。例如,在Java中:



如何从Java头中检索IP地址



编辑:不依赖IP地址的解决方案在这里更详细:



如何唯一标识访问我的网站的计算机? / a>


I'm looking to identify each computer that accesses my website independent of cookies.

I know it can be done because Twitter does it. Here's proof:

  1. Reset a browser (no cookies, no cache, total reset)
  2. Visit twitter.com
  3. Note the value of newly added _twitter_sess cookie
  4. Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before
  5. Change IP addresses
  6. Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before
  7. Change Browsers
  8. Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before
  9. Change User Agents
  10. Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before
  11. Change Computers
  12. Repeat Steps 1 - 3. Cookie _twitter_sess will finally be different

How can I do the same? I'd like to track individual computers that visit my site independent of them clearing cookies, or expiring cookies.

解决方案

Sounds like Twitter checks IP addresses from the browser request headers, so you would need to implement something similar on the server side when your request comes in. For example, in Java:

How can I retrieve IP address from HTTP header in Java

Edit: A solution that doesn't rely on IP addressed in more detail here:

How do I uniquely identify computers visiting my web site?

这篇关于如何识别我的网站上没有Cookie的特定计算机(就像Twitter一样)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆