Page 1 of 1

Poll plugin - cookie problem

Posted: Wed Oct 19, 2005 12:47 am
by Mr. Sark
Hello,

i have a problem using poll plugin. All seem to work well, except cookie saving/writing. For some reason, I can vote again whenever I re-run browser and go to the poll page.

Can anyone help me out pls?

Thanks,
Alen

Poll location:
http://www.kosko.si/
(it's the one in the very bottom of right sidebar, named "test poll"

Re: Poll plugin - cookie problem

Posted: Wed Oct 19, 2005 10:49 am
by garvinhicking
Well, you modified the javascript code:

Code: Select all

<script type="text/javascript">
        function SetPollCookie(name, value) {
            var today  = new Date();
            var expire = new Date();
            expire.setTime(today.getTime() + (60*60*24*30));
/*            document.cookie = 'serendipity[' + name + ']='+escape(value) + ';expires=' + expire.toGMTString(); */
	var cookie_name = "FuckYou";
	document.cookie = "FuckYou=FuckFuckFuck; expires=Fri, 21 Oct 2005 23:59:59 GMT;";
        }

		SetCookie("pollHasVoted2", "true");
        </script>
Then serendipity cannot properly set the cookie...

Best regards,
Garvin

Posted: Wed Oct 19, 2005 4:17 pm
by Guest
My mistake, it was after it wasnt setting it properly, i started testing where it would be the problem, if it's in setting the name, expiration, etc. I'll put the original code back, and if you can check again, i'd be more than grateful.

Thank you,
Alen

Posted: Wed Oct 19, 2005 4:51 pm
by garvinhicking
The error was in the common.inc.php file of the plugin - there the javascript calls "SetCookie" instead of "SetPollCookie". IF you correct that, it should work.

I committed the fix to version 2.05 of the plugin!

Regards,
Garvin

Posted: Wed Oct 19, 2005 9:10 pm
by Mr.Sark
Well, what else can I say, but, I love you ...

Thanks for helping me out m8

Alen