如何识别我的网站上没有Cookie的特定计算机(就像Twitter一样)? [英] How can I identify a particular computer on my website without cookies (just like Twitter does)?
问题描述
我知道这可以做,因为Twitter可以做到。以下是证明:
- 重置浏览器(无Cookie,无缓存,完全重置)
- twitter.com
- 请注意新添加的
_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中:
编辑:不依赖IP地址的解决方案在这里更详细:
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.com
- 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一样)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!