I am working on a PHP script that allows users to vote on certain items. Any user whether logged in or not can vote. Consider the following cases:
- If the user is logged in, I can log user's id, and can restrict voting on the same item if he tries to vote again.
- If the user is not logged in, I can log user's IP, and restrict voting on the same item, from the same IP.
If it's the first case, there's no need to log the IP. Now, the second case is driving me nuts, sort of. I was wondering that it may happen that the user may be changing IP, and then votes again on the same item. Now, even if I use Cookies or Session vars, it may also happen that the user is starting a new session (or has deleted the cookies) to vote on the same item again.
Am I missing something? If not, how to handle such situations? Any thoughts?