CAPTCHA validation error: unknown CAPTCHA session ID

Created on 28 February 2024, over 1 year ago

We recently migrated to Drupal 10 and are now using the latest version of Captcha/Recaptcha but we seem to be getting lots of complaints from our users receiving this error: CAPTCHA validation error: unknown CAPTCHA session ID. We did not seem to have this issue before moving to the D10 and the latest module.

I've read through a bunch of threads as well as applying this patch: https://www.drupal.org/files/issues/2019-11-15/3035883-29-workaround.patch but nothing has seemed to work. It seems to be random also as I cannot replicate this issue.

Any suggestions would be appreciated.

Thanks!
Aaron

🐛 Bug report
Status

Active

Version

3.2

Component

reCAPTCHA V2

Created by

🇨🇦Canada abryenton@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @abryenton@gmail.com
  • Status changed to Postponed: needs info 12 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Any chance to reproduce this in a vanilla Drupal environment or a test case? Othwerwise this will be hard to fix. Maybe you can provide details or a MR with a fix?

  • 🇺🇸United States mitchel432

    I wanted to share some additional information I discovered while troubleshooting an issue with webforms that span multiple pages. Specifically, I found that my ReCaptcha V3 was breaking in these multi-step workflows.

    It appeared that the setting on Captcha "Omit challenges in a multi-step/preview workflow" wasn't being respected. After some investigation, I found that ReCaptcha V3 switches to the fallback option during submission to catch any CAPTCHA errors (https://git.drupalcode.org/project/recaptcha_v3/-/blob/2.0.x/recaptcha_v...).

    At this point, I noticed our fallback option was set to use the ReCaptcha module, which is always marked as cacheable. This meant it wasn’t updating the Captcha session to reflect that it had already been passed (https://git.drupalcode.org/project/captcha/-/blob/2.x/captcha.module?ref...).

    I didn’t need the full patch mentioned here — I only needed the default #cache setting to be set to FALSE. I can provide a patch if needed, but I wasn’t sure if there was a specific reason this was originally set to be cacheable.

Production build 0.71.5 2024