English 中文(简体)
Tracking and logging anonymous users
原标题:

If you let anonymous users vote for any post on a site just one time and you log that vote by the user s IP, what s the likelihood that you d be banning other users from voting and that the original user would be able to vote again after a certain amount of time because their IP address has changed? I m guessing almost certainly.

Client side cookies can be deleted and server side cookies again have no way to reliably map said cookie to the anonymous user.

Does this mean there is no reliable way of tracking anonymous users indefinitely?

最佳回答

Using only IP addresses for user authentication/identification is extremely unreliable. There might be many hundreds or even thousands of users behind one IP (e.g a corporate network) and for most of those on home connections their IPs are likely to be dynamic and regularly changing.

You have to use Cookies for more reliable tracking. You can specify just about any time-to-live for a cookie, so that when an anonymous user returns, you can identify him.

Of course cookies can be deleted by users, so they could delete their cookies and vote again. However, is this likely to be a big problem? If someone really wants to game your poll, they could write a script. However, you could add a few basic security features: only allow some maximum votes per IP per day, and allow only so many votes per IP per second.

问题回答

If you let anonymous users vote for any post on a site just one time and you log that vote by the user s IP, what s the likelihood that you d be banning other users from voting

Unless that page is extremely popular, it s very unlikely that someone else being assigned the same IP address by the ISP would also visit it.

Edit: Users using the same IP address due to NAT are a much bigger problem and probably a deal-breaker for using the IP address. I d be less worried about corporate networks than about private home networks: very common, and having two people in the same household wanting to visit and vote on the same site is rather more likely than two random strangers.

and that the original user would be able to vote again after a certain amount of time because their IP address has changed? I m guessing almost certainly.

It s not just a question of time; most ISPs assign IP addresses upon connect, so all someone has to do to get a new one is to reinitialize their DSL connection (or whatever they use).

Does this mean there is no reliable way of tracking anonymous users indefinitely?

Correct.

Yes, there is no certainty in tracking IP addresses or using cookies.





相关问题
How to suppress/remove PHP session cookie

I need to suppress an already set session cookie header, but I cannot find any way to do this. Why? I need to make an image, sent by a PHP script, cacheable by the end user; this image is used to ...

Remove Cookies from JS or CSS files

Bizarrely my javascript and css files have cookies (says Firebug). I use Zend Framework and I think it has to do with it. Could I change the .htaccess that CSS or JS files don t link to the ZF or is ...

httplib2, how to set more than one cookie?

As you are probably aware, more often than not, an HTTP server will send more than just a session_id cookie; however, httplib2 handles cookies with a dictionary, like this: response, content = http....

cookies control

what tool wold you recommend me to use in order to see what data are stored in my cookies while i m browsing the net. I m a beginner into webdev field(6 months php experience) and i m curious to see ...

热门标签