Anonymous users are getting 403 error when voting or undoing voting, even when they have permission to do it.

It's because using drupal_get_token and drupal_is_valid_token with anonymous users. Drupal 7 doesn't save user session for anonymous users, so session_id is different on every page load, and tokens doesn't fit from one page to another.

CommentFileSizeAuthor
#1 plus1_anonymous_cant_vote-1886114.patch600 bytesgrisendo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

grisendo’s picture

I attach a patch.

grisendo’s picture

Status: Active » Needs review
grisendo’s picture

Title: Anonymous users 301 when voting/undoing voting » Anonymous users 403 when voting/undoing voting

Sorry, 403, not 301 :P

rogical’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Status: Needs review » Postponed

Please try the dev version, the dev seems working.

grisendo’s picture

Ok, now I can see that this should be fixed because of #1217670: Guest unable to vote

grisendo’s picture

Status: Postponed » Closed (duplicate)
grisendo’s picture

Issue summary: View changes

403, not 301 :P