You are here

public function SimpleReCaptchaFormManager::clearSessionData in Simple Google reCAPTCHA 8

Submit callback for form to clear no-longer needed session data.

The session will automatically terminate if this was the only thin in it.

File

src/SimpleReCaptchaFormManager.php, line 286

Class

SimpleReCaptchaFormManager
Provides helper service used to attach reCaptcha to forms.

Namespace

Drupal\simple_recaptcha

Code

public function clearSessionData(&$form, FormStateInterface &$form_state) {
  $session_key = 'simple_recaptcha';
  if ($this->session
    ->has($session_key)) {
    $this->session
      ->remove($session_key);
  }
}