Question:
How to resolve this error: CAPTCHA validation error: unknown CAPTCHA session ID. Contact the site administrator if this problem persists.
Solution:
Edit the recaptcha.module file:
change this code:
// As the validate callback does not depend on sid or solution, this
// captcha type can be displayed on cached pages.
$captcha['cacheable'] = TRUE;
By this code:
// As the validate callback does not depend on sid or solution, this
// captcha type can be displayed on cached pages.
//$captcha['cacheable'] = TRUE;
$captcha['cacheable'] = FALSE;
\Drupal::service('page_cache_kill_switch')->trigger();