Search code examples
phpdatabase-designcookiesproject-planningvoting-system

Implementing a voting system without requiring registration


I'd like to implement a voting system on my site, without having to force them to create an account. They would ultimately be voting up/down a piece of content which has a unique ID.

  • I know that I could store entries in a table with IP/ID, but what if there are more than one user coming from the same IP?
  • Is there a way to uniquely identify visitors without it being tied to their external ip?
  • If created a GUID, store it in a cookie on that machine, could it be retrieved later on that same computer with the same IP? A different IP?

Any thoughts on these questions, or any insight to a better approach would be greatly appreciated.


Solution

  • Yes, you could use a cookie and set the expiration very far into the future; however, there is nothing stopping anyone from clearing their cache and voting again.

    Your best bet, is to use the cookie and don't allow votes from the same IP within 15 minutes of each other... without registration thats the best you can do.