Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PdoSessionHandler.php

function PdoSessionHandler::doDestroy

Overrides AbstractSessionHandler::doDestroy

File

vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php, line 312

Class

PdoSessionHandler
Session handler using a PDO connection to read and write data.

Namespace

Symfony\Component\HttpFoundation\Session\Storage\Handler

Code

protected function doDestroy(string $sessionId) : bool {
    // delete the record associated with this id
    $sql = "DELETE FROM {$this->table} WHERE {$this->idCol} = :id";
    try {
        $stmt = $this->pdo
            ->prepare($sql);
        $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
        $stmt->execute();
    } catch (\PDOException $e) {
        $this->rollback();
        throw $e;
    }
    return true;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal