/** * Destroy the session and optionally specify $regenerate = true * to regenerate a new session id. * * @param boolean $regenerate * @throws \Exception * @return boolean */ public function destroy($regenerate = false) { $this->instance->unlock(); $result = $this->instance->destroy(); if ($regenerate == true) { session_regenerate_id(true); } return $result; }
/** * Destroy an authentication session. * * @return boolean */ public function logout() { if ($this->instance instanceof \Phavour\Session\Storage) { if ($this->instance->isLocked()) { $this->instance->unlock(); } $this->instance->destroy(); } return false; }