How to Limit Votes to One per User?
Question:
How to prevent users from voting multiple times?
Answer:
The most foolproof way to enforce one vote per user is to require users to login to your app in order to vote. Ask new users to register first, then use their username in an auto field in the vote form. In the votes table make username Unique. This way each user can only vote once.
If user registration is not an option, another way is require an email address as part of the vote submission. By making the email field in the table unique you prevent duplicate emails, however users may still use multiple fake email addresses. You can take this one step further and require verification by email before a captured vote is actually counted.
If only invited users are allowed to vote, you could create a blank record for each of them along with a unique AutoValue GUID field that you use in a custom URL that leads them to the form which is really an Update form and looks up their record through the passed GUID and allows them to enter their submissions. With this method you could also prevent them from changing their vote once it is submitted.
If the voting is anonymous, you may consider using a cookie to remember if a user has already submitted a vote. This method is easy to get around by clearing the cookie, using different browsers or different machines.
