I'm currently running a poll on my site, but the Poll module let's anonymous users vote several times??
I thought this was restricted to one vote pr IP ??

When they vote, they never see the results bars, just the vote page over again...

Comments

juliekj’s picture

I think I solved it... cleared the cache and it looks to work OK now...

As If’s picture

Not sure if this is the same issue or not. I think it is, but mine only occurs on the front page, in the Latest Poll block. The front page is a View ("frontpage"). The Latest Poll block appears on every page. Version 6.10. In case it's important, I have added a CCK imagefield to the Poll type.

Page Caching Normal and Block Caching Disabled, with No Minimum Cache Lifetime:
If I vote as an anonymous user it tallies my vote. As move around the site, the poll block remembers that I voted and displays the totals. But when I go back to the home page again, the block forgets and gives me the poll again. If I vote, then close all browser windows and come back to the site, it remembers, but if I leave the front page and come back to it again, it forgets again. Yes, clearing the cache solves it - but only for a few minutes.

Page Caching Normal and Block Caching Disabled, with Minimum Cache Lifetime 1 minute:
Behaves just as above, no matter how much time elapses.

Page Caching Disabled and Block Caching Disabled, with No Minimum Cache Lifetime:
Behaves as expected (i.e., the block is not cached and remembers my vote), but server load doubles. I don't like that.

It seems like the poll block is being cached with the front page, regardless of the Block Cache settings. (?)

-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com

As If’s picture

I have since discovered that this behaviour is by design in Drupal 6. The Page Cache will override any settings for Block Cache (for anonymous users). You might want to try installing the blockcache_alter module.

-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com

carole’s picture

I have the opposite problem. I'm using "Latest Poll" block on all pages, and after voting on one machine, when I view the site in multiple browsers (even another PC on my lan, perhaps sharing my IP address, not sure), I see the results, not the poll form. I want the poll form to remain until after the poll is closed, even to allow multiple votes per IP (for cybercafes). Any tips?

As If’s picture

Well obviously, don't cache the block and don't use a minimum cache lifetime*. But you're also going to need to modify the settings file (I think) to drastically reduce or zero out the cookie duration.

* Actually since my last post in this thread I have discovered that there are *other* problems with minimum cache lifetime > 0. It's going to need serious fixing. Best advice right now is to leave it at zero, regardless of your actual situation.

-------------------------------------------
Interactive Worlds and Immersive Obsessions
http://www.asifproductions.com

carole’s picture

Will disabling the cookie impact anything else? Any docs on how to change the settings? Plus I was getting the results before I turned on any caching, so I'm discouraged that disabling caching will give me the results I want, although they worked for the original poster.

artofeclipse’s picture

I have the same problem and I can't get it working for anonymous users, all anonymous users have the result and they can't vote and I have my site hosted on a server that use "Varnish" to cache the website, how can I solve it without break any settings on my server, please help, any advice will be appreciated.

onelittleant’s picture

The page cache is doing what it is supposed to do. Poll module is doing what it's supposed to do. They just don't work well together.

The page cache will cache the current page if it has not already. If the person requesting the page happens to have voted on a poll, then the page will show the results, that page will be cached, and subsequent visitors will see the poll results, not the voting option.

Boost, varnish, page cache, they all have the same limitation. The block cache never gets involved if the page cache serves a cached page.

The solution you're looking for may be here:

http://drupal.org/project/ajaxblocks/

Load the poll block dynamically for all users, while the rest of the page is cached.

onelittleant’s picture

I can confirm that the ajaxblocks method in D7 takes care of the page cache issue when using the Drupal page cache. It requires that the poll block be loaded uncached via ajax, but the result is a block that reponds appropriately to anonymous user cookies.