If cookies are disabled, CAPTCHA validation is impossible.
The user gets in this case a message "invallid CAPTCHA token", which is cryptic and contains no indication how (s)he could solve this problem.

This patch detects on validation if cookies are disabled and generates a more user friendly error message "Cookies should be enabled in your browser for CAPTCHA validation."

CommentFileSizeAuthor
cookies_1.patch1.2 KBsoxofaan

Comments

phillipadsmith’s picture

Hi ho,

After investigating the issue with CAPTCHA validation for IE7 users, I stumbled on this patch. And, after patching, it's clear that IE7 is blocking cookies and preventing the CAPTCHA from validating. So, I'm wondering, is there a long-term solution to address CAPTCHA validation for users with cookies disabled / blocked?

Phillip.

robloach’s picture

Status: Reviewed & tested by the community » Fixed

Trusting you on this one ;-) .

robloach’s picture

Status: Fixed » Patch (to be ported)

Needs to move to HEAD for Drupal 6.

soxofaan’s picture

Maybe it was to early to commit (but it doesn't hurt either).

I'm a bit concerned about #1.
The patch did not really check for cookies, but it checks for a symptom when cookies are not enabled (no $_SESSION).
It could be that the problem reported in #1 is a false negative detection: cookies are enabled but still no $_SESSION.

Since I don't have IE7 in my toolbox, I can't check this. Rob (you're a windows guy, right?) can you check this?

robloach’s picture

I tested and it worked. I couldn't get it to deny my access though.

phillipadsmith’s picture

Happy to test also... just let me know. I'm unclear on the session question, however.

The behavior I saw was that if IE7's "Privacy" settings are higher than the default, the browser rejects all cookies and the CAPTCA then has a value of "" (null) (at least, that's what shows in the log).

I adjusted the message to something a bit more helpful, and provided a couple of links on how to adjust those settings on popular browsers.

:-)

Phillip.

phillipadsmith’s picture

Here's a relatively thorough / informative page that could be linked from the error message:
http://www.google.com/support/accounts/bin/answer.py?answer=61416

soxofaan’s picture

Status: Patch (to be ported) » Fixed

In HEAD I started with an experimental CAPTCHA branch for Drupal 6,
In the first iteration (http://drupal.org/cvs?commit=101505) I replaced the storage of the solution in the $_SESSION variable with a dedicated table {captcha_challenges}. One of the advantages of this design is that CAPTCHA now also works when cookies are disabled. Yay.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

soxofaan’s picture

Version: 5.x-3.x-dev » 6.x-1.x-dev
Component: Code » User interface

#301564: Warn when cookies are disabled reminded me that this feature needed to be ported to 6.x-1.x
http://drupal.org/cvs?commit=136946