function SessionHandler::destroy

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Session/SessionHandler.php \Drupal\Core\Session\SessionHandler::destroy()
  2. 8.9.x core/lib/Drupal/Core/Session/SessionHandler.php \Drupal\Core\Session\SessionHandler::destroy()
  3. 11.x core/lib/Drupal/Core/Session/SessionHandler.php \Drupal\Core\Session\SessionHandler::destroy()

File

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

Class

SessionHandler
Default session handler.

Namespace

Drupal\Core\Session

Code

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

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