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"
Poll plugin - cookie problem
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Poll plugin - cookie problem
Well, you modified the javascript code:
Then serendipity cannot properly set the cookie...
Best regards,
Garvin
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>
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
Guest
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
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
I committed the fix to version 2.05 of the plugin!
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/