Marko
Marko

Reputation: 72230

Public Rating script, allowing 1 submission per visitor

I've written a .NET/jQuery rating script that allows users to rate a particular product.

Everyone that visits the website can rate, but I'd like to only allow 1 rating per visitor.

So far I've considered the following options.

1: Store the users IP address and only allow 1 submission per IP.

Of course, this would mean that people on corporate LAN's, Internet cafe's, public Wi-Fi's and such won't be able to vote after someone else has from the same location.

2: After voting, create a cookie in their browser that indicates they've voted.

This isn't a good solution either, since people using Private Browsing will be able to vote as many times as they like, OR a more advanced user will clear their cookies and keep submitting a vote over and over again.

So, is this possible?

Upvotes: 2

Views: 708

Answers (3)

Aristos
Aristos

Reputation: 66649

I say that you can check if the computer accept Cookies. If not accept cookies do not let him vote.

Second you can check how many pages every voter have see.

And how close is one vote to the other in time.

Now the person that try to make many votes, comming from the same ip, see 2 pages max, vote many times in a sort time, and probably not accept cookies.

I say all that, even tho I agree with Oded say.

Upvotes: 1

Maksim Vi.
Maksim Vi.

Reputation: 9235

There is no good solution for unregistered users, you could use ip and user agent combination, but still the best solution is to use their user ids, in other words visitors must be registered on your website first.

Upvotes: 1

Oded
Oded

Reputation: 499382

A cookie is what most sites use.

Though it is true that some users will be able to vote more than once, you need to ask yourself, how many advanced users are you going to have, and how many of those will really care enough.

In regards to cookies - nothing stops the same person from using another browser on the same computer, go to a different computer (which may also defeat the IP scheme) etc.

To ensure single vote per user have each login before voting - if you have a way to prevent multiple logins per user, limiting them to a single vote should be easy.

Upvotes: 1

Related Questions