function SessionHandler::doDestroy

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Session/SessionHandler.php \Drupal\Core\Session\SessionHandler::doDestroy()
1 call to SessionHandler::doDestroy()
SessionHandler::destroy in core/lib/Drupal/Core/Session/SessionHandler.php

File

core/lib/Drupal/Core/Session/SessionHandler.php, line 116

Class

SessionHandler
Default session handler.

Namespace

Drupal\Core\Session

Code

protected function doDestroy(#[\SensitiveParameter] string $sessionId) : bool {
  try {
    // Delete session data.
    $this->connection
      ->delete('sessions')
      ->condition('sid', Crypt::hashBase64($sessionId))
      ->execute();
  } catch (\Exception) {
  }
  return TRUE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.