Exemple #1
0
 /**
  * Destroy a session
  * @private For internal use only
  * @param string $id Session id
  * @return bool Success
  */
 public function destroy($id)
 {
     if (self::$instance !== $this) {
         throw new \UnexpectedValueException(__METHOD__ . ': Wrong instance called!');
     }
     if (!$this->enable) {
         throw new \BadMethodCallException('Attempt to use PHP session management');
     }
     $session = $this->manager->getSessionById($id, false);
     if ($session) {
         $session->clear();
     }
     return true;
 }