delete() public method

public delete ( integer | string $keyName ) : boolean
$keyName integer | string
return boolean
Example #1
0
 /**
  * {@inheritdoc}
  *
  * @param string $sessionId Session variable name [Optional]
  * @return bool
  */
 public function destroy($sessionId = null)
 {
     if (null === $sessionId) {
         $sessionId = $this->getId();
     }
     if (!isset($_SESSION) || !is_array($_SESSION)) {
         $_SESSION = [];
     }
     foreach ($_SESSION as $id => $key) {
         unset($_SESSION[$id]);
     }
     return $this->db->delete($sessionId);
 }