How can I identify a particular computer on my website without cookies (just like Twitter does)?

本秂侑毒 提交于 2019-12-08 01:31:57

问题


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.


回答1:


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?



来源:https://stackoverflow.com/questions/21263246/how-can-i-identify-a-particular-computer-on-my-website-without-cookies-just-lik

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!