public function PdoSessionHandler::destroy in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php \Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::destroy()
 
File
- vendor/
symfony/ http-foundation/ Session/ Storage/ Handler/ PdoSessionHandler.php, line 301  
Class
- PdoSessionHandler
 - Session handler using a PDO connection to read and write data.
 
Namespace
Symfony\Component\HttpFoundation\Session\Storage\HandlerCode
public function destroy($sessionId) {
  // 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;
}