From 7cf3c489234e2dca7d6187f0561c7dd4c14ef4fc Mon Sep 17 00:00:00 2001
From: Christian Biggins <cbiggins@gmail.com>
Date: Wed, 20 May 2015 18:50:07 +1000
Subject: [PATCH] 2491913 Fixing cookie match

---
 advpoll.module               | 1 +
 includes/advpoll_voteapi.inc | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 includes/advpoll_voteapi.inc

diff --git a/advpoll.module b/advpoll.module
index bbafbc0..17f0f8d 100644
--- a/advpoll.module
+++ b/advpoll.module
@@ -740,6 +740,7 @@ function advpoll_form_submit($form, &$form_state) {
     foreach ($selected as $item) {
       $vote = array();
       $vote['type'] = 'node';
+      $vote['nodetype'] = $node->type;
       $vote['tag'] = $item;
       $vote['nid'] = $nid;
       $vote['value'] = 1;
diff --git a/includes/advpoll_voteapi.inc b/includes/advpoll_voteapi.inc
old mode 100644
new mode 100755
index c5688be..3d6b5ed
--- a/includes/advpoll_voteapi.inc
+++ b/includes/advpoll_voteapi.inc
@@ -307,7 +307,8 @@ function advpoll_add_votes($vote) {
       // Raw cookies are safe in this case as we're only passing a static value
       // to mark that this user voted on their machine.
       global $cookie_domain;
-      setrawcookie($vote['type'] . $vote['nid'], 'vote', time() + (60 * $vote['duration']), '/', $cookie_domain);
+
+      setrawcookie($vote['nodetype'] . $vote['nid'], 'vote', time() + (60 * $vote['duration']), '/', $cookie_domain);
     }
 
     $votes = array(
-- 
2.3.2 (Apple Git-55)

