samedi 16 avril 2016

Poll app, avoid multiple votes from same person

I'm developing a web application with Django which involves some different polls. I display a question followed by some links, and the user clicks on the link which he/she prefers. For example:

<p>Which one do you prefer?</p>
<a href="http://ift.tt/1MzMLls" >Option 1</a>
<a href="http://ift.tt/1Qef8QK" >Option 2</a>
<a href="http://ift.tt/1MzMLBI" >Option 3</a>
<a href="http://ift.tt/1Qef6Is" >Option 4</a>

Each link takes the two numbers 15 which represents the poll number 15 and increases by a vote the option selected, for example 1.

The problem comes that probably some users would start refreshing the webpage like crazies selecting their option, entering the link http://ift.tt/1MzMLls in their browser to vote for it a lot of times.

Is there a way to avoid this problem? Should I store the IPs of the voters to the database for x time to avoid them voting more than once in x time? Wouldn't this be a problem for a lot of users?

Thanks!




Aucun commentaire:

Enregistrer un commentaire