views:

117

answers:

5

I am about to write a voting method for my site. I want a method to stop people voting for the same thing twice. So far my thoughts have been:

  • Drop a cookie once the vote is complete (susceptible to multi browser gaming)
  • Log IP per vote (this will fail in proxy / corporate environments)
  • Force logins

My site is not account based as such although it aggregates twitter data so there is scope for using Twitter OAuth as a means of identification.

What existing systems exist and how do they do this?

+6  A: 

The best thing would be to disallow anonymous voting. If the user is forced to log in you can save the userid with each vote and make sure that he/she only votes once. The cookie approach is very fragile since cookies can be deleted easily. The ip-approach has the short coming you yourself describe.

klausbyskov
Would it be possible for me to use their twitter login as a login to my site? So that as long as they were logged into twitter they could access my site?
Chris
@Chris, yes. The easiest way would probably be to use a third party SSO provider such as http://www.janrain.com/
klausbyskov
Thanks I think this'll work pretty well!
Chris
Not always deleted easily. http://stackoverflow.com/questions/3968328/best-method-to-prevent-gaming-with-anonymous-voting/3968666#3968666
bzlm
+2  A: 

One step towards a user auth system but not all of the complications:

Get the user to enter their email address and confirm their vote, you would not eradicate gaming but you would make it harder for gamers to register another email address and then vote etc.

Might be worth the extra step.

Let us know what you end up going for.

Question Mark
A: 

Different approach, just to provide an alternative:

Assuming most people know how to behave or just can't be bothered to misbehave, just retroactively clean the votes. This would also keep voting unobtrusive for the voters.

So, set cookies, log every vote and afterwards (or on a time interval?) go through the results and remove duplicates based on the cookie values, IP/UserAgent combinations etc.

I'd assume that not actively blocking multiple votes from same person keeps the usage of highly technical circumvention methods to a minimum and the results are easy to clean.

As a down side, you can't probably show the actual vote counts live on the user interface, or eyebrows will be raised when bunch of votes just happen to go missing.

nnevala
A: 

If you want to go with cookies after all, use an evercookie.

evercookie is a javascript API available that produces extremely persistent cookies in a browser. Its goal is to identify a client even after they've removed standard cookies, Flash cookies (Local Shared Objects or LSOs), and others.

evercookie accomplishes this by storing the cookie data in several types of storage mechanisms that are available on the local browser. Additionally, if evercookie has found the user has removed any of the types of cookies in question, it recreates them using each mechanism available.

Multi-browser cheating won't be affected, of course.

bzlm
Be warned: if you visit the evercookie site it will (attempt to) put an evercookie on your browser. The Comments on a recent Bruce Schneier post contains an interesting discussion of the site: http://www.schneier.com/blog/archives/2010/09/evercookies.html
APC
@APC Why does that warrant a warning? I think most sites, when visited, attempt to put a cookie on my browser. :)
bzlm
The point about evercookies is that the software will try to put one of its uber-cookies on you even if you have set your browser to not accept third-party cookies. Of course, imost people really don't care. But some people get quite aerated on the topic.
APC
@APC Some users... and the European Union. :) http://blogs.wsj.com/digits/2009/11/11/europe-approves-new-cookie-law/
bzlm
Who games a vote with a browser? :)
Øyvind Skaar
A: 

Although I probably wouldn't do this myself, but look at these cookies, they are pretty hard to get rid of:

http://samy.pl/evercookie/

A different way that I had to approach this problem and fight voting fraud, was to require an email address, then a person could still vote, but the votes wouldn't count until they clicked on a link in the email. This was easier than full on registration, but was still very effective in eliminating most of the fraudulent votes.

Andre
Oops, saw that somebody already suggested evercookie
Andre
@Andre Someone suggested the e-mail thing as well. :) http://stackoverflow.com/questions/3968328/best-method-to-prevent-gaming-with-anonymous-voting/3968430#3968430
bzlm