I am doing a voting system on my website.
Visitors do not need to login to vote the product they like. But how can I prevent them from clicking the like or dislike button many times for one product ?
I intend to detect the IP address of the visitor to avoid vote spam. Is that a good way?
Thanks for any suggestions!
No that is not a good way. IP can be common via proxy – colleges and large businesses for example.
You could store a cookie, but that can easily be circumvented.
The concise answer is that controlled voting should probably be handled through a login handler and not just wide open to the public. But if you do want to leave it wide open to the public, then you have to accept the flood of badness that may come with that decision.
I would go with at least cookies. Not a whole lot of people care to clear cookies just to game a voting system unless there is a reason.