问题
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_sesscookie - Repeat Steps 1 - 3. Cookie
_twitter_sesswill have the same value as before - Change IP addresses
- Repeat Steps 1 - 3. Cookie
_twitter_sesswill have the same value as before - Change Browsers
- Repeat Steps 1 - 3. Cookie
_twitter_sesswill have the same value as before - Change User Agents
- Repeat Steps 1 - 3. Cookie
_twitter_sesswill have the same value as before - Change Computers
- Repeat Steps 1 - 3. Cookie
_twitter_sesswill 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