"Invalid CAPTCHA token" on user registration form
marcus0263 - April 12, 2008 - 04:41
| Project: | CAPTCHA |
| Version: | 6.x-1.0-rc2 |
| Component: | Captcha API (captcha) |
| Category: | support request |
| Priority: | normal |
| Assigned: | soxofaan |
| Status: | active (needs more info) |
Description
Since upgrading to Drupal 6.2 Captcha is seriously broke. When ever attempting to register new user this error keeps coming up. I've uninstalled, removed and reinstalled Captcha with no success.

#1
I can't reproduce this with Drupal 6.2 and CAPTCHA 6.x-1.0-rc2
If I understand you correctly:
You had first a Drupal 6.1 installation with CAPTCHA 6.x-1.0-rc1 and CAPTCHA on user registration worked as desired.
You upgraded to Drupal 6.2 and CAPTCHA 6.x-1.0-rc2 and CAPTCHA on user registration stopped working?
Is this correct (especially that it worked before the upgrade)?
Does CAPTCHA 6.x-1.0-rc2 work on other things like the comment forms?
Please check for both anonymous as authenticated users (without skip CAPTCHA permission of course).
#2
Yes everything was working fine before the upgrade to Drupal 6.2 with Drupal 6.1.
I restrict anonymous access and the only Captcha I have active is for new user registration.
I'll test tonight more thoroughly and post the results
Cheers
#3
I am also having this issue with Drupal 6.2 and 6.x-1.0-rc2 of CAPTCHA. I did not however, have CAPTCHA installed in drupal 6.1 - the last time I had it installed was Drupal 4.7 before I upgraded to 5.7, then 6.1, then 6.2 last week, and I removed the module when I upgraded to 5.7, and didn't reinstall it until after I upgraded to 6.2.
This appears to be something in the CAPTCHA core, since it shows up when using text captchas or the recaptcha module.
#4
Please also check:
#5
I am seriously confused now. AFAIK, I didn't touch anything, but now captchas are working fine. So, 6.x-1.0-rc2 works fine for me in Drupal 6.2.
#6
i am also getting this "Invalid CAPTCHA Token." with captcha rc2any module(reCaptcha, captchapack...)
#7
@peregina: please provide more information (which forms, which user roles)
also try the CAPTCHA with authenticated users without the skip CAPTCHA permission
#8
well, if i remove the skip captcha in all roles, it works. I bet theres the error.
#9
it's fixed then
#10
No its not. I still get the same error, and Ive tried reinstalling the module and everything, it keeps coming up with Invalid Token errors every time, and no users had the 'Skip captcha' permission, so I dont know whats wrong with it, it just suddenly stopped working overnight, i hadnt installed any new modules, it just stopped working. Its really really annoying, so I just disabled the module and removed it until the next release. I was only using it to protect login/registration forms anyway.
#11
I can't reproduce this error with
* Drupal 6.2
* CAPTCHA 6.x-1.0-rc2
* math CAPTCHA on user registration form
The error message "invalid CAPTCHA token" is a typical symptom of session problems. The CAPTCHA solutions are stored server side in the session data, so sessions are required for CAPTCHAs to work. (CAPTCHA 6.x-2.x probably won't have this requirement.)
Getting "Invalid CAPTCHA token" for anonymous user typically means that anonymous users don't have persistent session data.
This often happens when there is no entry for uid=0 in the users table. Also see
#245451: Image is not visible because of no uid=0 in users table
#243285: Captcha not working when no sessions for anonymous
#179915: Resolved: Captchas don't work on second site (was missing user UID 0 in database)
#204095: Error: 'Cookies should be enabled in your browser for CAPTCHA validation.'
If I delete the entry with uid=0 in my users table, I can reproduce the error.
So please check if you have an entry for uid=0 in the users table of your database
or
try CAPTCHA on for example comment forms with an authenticated user (a user that is logged in) without the skip CAPTCHA permission
#12
This patch adds a check for uid=0 in the users table and shows an error on the status report if it's not available.
#13
committed attached patch: http://drupal.org/cvs?commit=116712
To be ported to DRUPAL-5--3
Not an issue in HEAD because that branch does not depend on sessions
#14
committed in DRUPAL-5--3
http://drupal.org/cvs?commit=120249
#15
Automatically closed -- issue fixed for two weeks with no activity.
#16
Did anyone ever figure this one out? I only use CAPTCHA for user login
any riddler login gets rejected once, with the error message
Invalid CAPTCHA token.
Second try lets you log in, but takes you to an 'Access denied' page
site: hautboy.org
Drupal 6.2
Captcha rc2
#17
are cookies enabled?
do other challenges work (like the builtin math captcha)?
#18
Sorry, but this is NOT closed. The problem has been identified. But what's the solution?
#19
Well, the problem is that there are several causes for getting the "invalid CAPTCHA token" error.
This thread is getting a bit messy with low signal-to-noise-ratio and different people with possibly different problems.
So if you want to contribute to this thread, or want this thread to be useful:
Please be very precise in describing your setup (which versions of drupal, modules, which browsers, cookies, users, forms, permission, etc) and the procedure to get the error message. I still can't reproduce the problem on my setup, which makes it very hard for me to debug, let alone to fix, something ;-)
#20
I don't know if this is relevant to this thread, but apparently people with IE7 will get this "Invalid CAPTCHA Token" if they have their Tools|Internet Options>Privacy setting set to "High" or to "Block All Cookies". It will work with setting set to "Medium High"
This with D6.4, CAPTCHA 6.x-1.0-rc2, and ASCII Art CAPTCHA 6.x-1.0-beta2.