Error: 'Cookies should be enabled in your browser for CAPTCHA validation.'

radmod - December 27, 2007 - 04:06
Project:CAPTCHA
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Issue tags:captchauid0
Description

The Captcha on user registration forms is totally broken on my site. Whenever someone tries to sign up for an account in any browser, they receive the message:

Cookies should be enabled in your browser for CAPTCHA validation.

I've tried switching themes, disabling the advertising module (which I've found has caused problems with other things before), and tried disabling all the captchas except the core Captch module. No luck.

#1

soxofaan - December 28, 2007 - 10:45
Category:bug report» support request
Priority:critical» normal
Status:active» postponed (maintainer needs more info)

When you get that message, it means that the CAPTCHA module is not able to use sessions (which require cookies in drupal).

Do you have non standard session settings for your Drupal install?
Do you have a user id 0 in your user table?
Does CAPTCHA work for authenticated (but non admin) users?

#2

radmod - December 30, 2007 - 19:20

Thanks for the response soxofan.

There is NOT a user with a uid of 0. My admin user is uid 1.

I don't think there are any non-standard session settings in my Drupal install. Is there something specific you know of that I can check?

The Captcha fails when an anonymous user tries to register (the only place I use a Captcha normally). I enabled it temporarily on the comment form, and it worked for a logged-in user. So it looks like it's just failing for anonymous users.

Does any of that help?

#3

soxofaan - December 30, 2007 - 20:36

There is NOT a user with a uid of 0.

This is the problem.
If you don't have a uid 0 in your users table, anonymous users don't get session based storage, and the CAPTCHA module can't do hist job properly.

If you know how to do this: add a record with uid = 0 to you user tabel, the other fields are not important, you can leave them empty/default.

Any ideas how that record could get lost? Some weird module or a funky upgrade?

#4

radmod - January 2, 2008 - 22:32

My install was originally Drupal 4.7 and upgraded to 5.x. Maybe its admin user ID starts at 0?

#5

soxofaan - January 3, 2008 - 11:17

Seems unlikely, since UID 0 was always reserved for the anonymous user, as far as I know.

Anyway, could you solve your problem by adding a record with UID 0?

#6

radmod - January 7, 2008 - 14:49
Status:postponed (maintainer needs more info)» fixed

Sorry for the delay, it took me a few days before I could try this out, and yes, it fixed the issue. Thanks for you help!

#7

Anonymous (not verified) - January 21, 2008 - 14:51
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#8

snicers - June 6, 2008 - 20:27
Version:5.x-3.1» 5.x-3.x-dev

Same problem here, but there is a user 0. After entering the captach math for 2-3 times the value is accepted and the user is registered.

#9

soxofaan - June 6, 2008 - 22:43

at #8: please be more descriptive.
From your description it even seems you have a different problem as discussed in this thread (if you would get "cookies should be enabled..." errors, you would not be able to get past the user registration form.) Please submit a separate issue for a different problem.

#10

stefan_pn - December 7, 2008 - 02:20
Version:5.x-3.x-dev» 6.x-1.x-dev

I use Drupal 6.6 I had the same Captcha problem with the cookies. I inserted in user table a line like you said and everything works fine now.
Thanks a lot

#11

andrus_k - December 10, 2008 - 13:38

Indeed, #3 fixes the problem!

#12

artscoop - December 12, 2008 - 17:58

Same issue.

The warning came from the blue.
When browsing as a guest, when I try to create a node, I get this warning.

However, I have *not* upgraded from a previous version of Drupal.

- A user with ID 0 *exists* in the database.
- The captcha is shown *only for guest users*
- I use PathAuto
- The node submit form is *shown in a block* on many pages.
- The locale is not en-US.
- I use Math and Text Captcha (because the Image Captcha does not appear anymore)

I can submit a node as a guest but I have to click the "Save" button twice.

Seems that this bug dit not occur earlier with the same configuration.

Any idea on this ?

#13

janusman - May 29, 2009 - 15:22

Adding User with uid=0 solved it in my case.

#14

irfanzone - June 3, 2009 - 14:48
Version:6.x-1.x-dev» 5.x-1.x-dev
Priority:normal» critical
Status:closed» active

HI Drupal Administrators,

I am facing the same issue.

I have got Drupal 5.14 installed on Unix Environment and when trying to access the CMS it has started to give the same Cookies Error

(Error: 'Cookies should be enabled in your browser for CAPTCHA validation.')

We have a user id=0 enabled in the User Table and cookies are enabled in all the browsers

Any help would be highly appreciated.

Thanks in advance for the support

#15

soxofaan - June 21, 2009 - 13:28
Priority:critical» normal
Status:active» postponed (maintainer needs more info)

at irfanzone: What kind of other modules do you have installed? Are there for example modules (or server settings) that interact/change PHP sessions?

#16

kakajoe - June 29, 2009 - 07:54

how to enable uid=0 ?? cause i got the same problem...some users of my website can't register ... im using D6

#17

soxofaan - June 29, 2009 - 08:16

how to enable uid=0 ?

Normally uid=0 is available by default in Drupal, so you don't have to enable anything. However, in some situations (for example moving a site with a MySQL dump and import) it's possible that uid=0 is lost. If that is the case: you should add an entry for this uid back to the users table in the database:
* go to your database, hosting providers typically provide an interface like phpMyAdmin
* go to the table "users"
* check if there is an entry for uid=0, if not add an entry with uid=0 (the other fields of the entry are not important, you can leave the defaults)

some users of my website can't register

If only some users can't register (and some others still can), you don't have a problem with uid=0.
When you don't have an uid=0 entry, no user whatsoever will be able to register.

#18

soxofaan - July 15, 2009 - 09:53

tagging

#19

mikki2 - August 2, 2009 - 00:40

I had a similar problem and correcting the $cookie_domain path in sites/all/default/settings.php fixed the problem. I had a wrong path set.

 
 

Drupal is a registered trademark of Dries Buytaert.