如何识别我的网站上没有Cookie的特定计算机(就像Twitter一样)?

编程入门 行业动态 更新时间:2024-10-24 01:48:12
本文介绍了如何识别我的网站上没有Cookie的特定计算机(就像Twitter一样)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

  • 重置浏览器(无Cookie,无缓存,完全重置)
  • twitter
  • 请注意新添加的 _twitter_sess cookie的价值
  • Cookie _twitter_sess 将具有与之前相同的值
  • 更改IP地址 b $ b
  • 重复步骤1 - 3. Cookie _twitter_sess 将具有与之前相同的值
  • 重复步骤1 - 3. Cookie _twitter_sess 将具有与之前相同的值
  • 更改用户代理
  • 重复步骤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:

  • Reset a browser (no cookies, no cache, total reset)
  • Visit twitter
  • Note the value of newly added _twitter_sess cookie
  • Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before
  • Change IP addresses
  • Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before
  • Change Browsers
  • Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before
  • Change User Agents
  • Repeat Steps 1 - 3. Cookie _twitter_sess will have the same value as before
  • Change Computers
  • 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一样)?

    本文发布于:2023-11-11 10:32:24,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1578176.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:就像   如何识别   计算机   网站   Cookie

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!