/** * Destroy current session and delete all the data * if deleteCookies flag is true, then delete corresponding cookies as well * * @param string $deleteCookies * @return boolean */ public static function destroy($deleteCookies = true) { if ($deleteCookies) { if (isset($_COOKIE[session_name()])) { $params = session_get_cookie_params(); // Setting cookie expiry date to '1980-01-01' setcookie(session_name(), false, 315554400, $params['path'], $params['domain'], $params['secure']); } } $isDestroyed = session_destroy(); if ($isDestroyed) { self::$_isSessionRunning = false; Logger::getLogger()->LogDebug('Session with ID : ' . Session::getSessionId() . 'is closing'); } return $isDestroyed; }