PHP session voting system?

I read about stackoverflow about creating PHP voting systems that minimize abuse / multiple voting from the same user, but I did not find the answer to my question.

I have an application in which users do not need to register to vote or an “how to” entry. Obviously, I want to minimize abuse, and I don’t want to limit the votes to each IP address, because some organizations (including mine) use shared IP addresses.

I had never used sessions in a system without authentication before, but since this application is centered around login votes (used for purely entertainment value, but I would like to minimize abuse anyway), I was wondering if this approach would work and if there were any Any flaws, such as performance implications, and is it possible to use sessions this way:

  • start a session when loading a website
  • allow one vote per item per session.

If this is a bad idea, my alternatives are to allow a reasonable number of votes per IP address (say 25) or set a time limit between voices from the same IP address.

What do you guys recommend / what do you find most annoying for the user? Restarting the browser, waiting 5 minutes between voices or clearing cookies?

+3
source share
4 answers

In fact, there is no way to make a “serious” voting system without user authentication, all other options have disadvantages:

  • sessions end when you close your browser, so just open it and you're fresh
  • A cookie is your best shot, but you can clear it or even refuse it.
  • IP addresses are unreliable and / or not applicable
+5
source

- , , . "". - ip-. cookie, "", cookie . ip-, , ip 25 cookie, . , , cookie, 25 .

+1

kemp , cookie - . , cookie - , cookie , "" cookie - , "".

IP-, - " IP-".

, - , , - (, 100 IP 5 ) - .

+1

cookie , apc/memcached. cookie apc / cookie . , , , - , reset .

This is not bullet proof, but in the absence of a database, I find this a good solution. Keep in mind that if the server shuts down, it will clear the apc cache.

0
source

Source: https://habr.com/ru/post/1742082/


All Articles