Page 1 of 1

Cookie test/detection

Posted: Fri Nov 28, 2003 10:56 am
by packito
hi!

I have a voting system that only adds a vote into a poll if the user haven't voted for that choice before, based on cookies stored on the user's computer. This works fine!
But how can i make sure only users with cookie enabled browsers are allowed to vote?? I mean, how can i test if a browser is accepting cookies? :?

Any help is appreciated. Thanks!

Posted: Fri Nov 28, 2003 11:12 am
by Weirdan
Simple solution: set cookie, then try to read it. ;) If read was successful - browser of user in question is cookie enabled.

Posted: Fri Nov 28, 2003 12:29 pm
by m3mn0n
Those cookie based tracking systems never work. Someone can clear cookies and vote an unlimited ammount of times.

May I suggest db storage of IPs or [php_man]sessions[/php_man]. :)

Posted: Fri Nov 28, 2003 1:30 pm
by Weirdan
No ultimate protection, you know ;) Different people can be behind one ip, sessions expire....