public static function doLogout($sid): bool {

		$app = Application::getInstance();
		$db  = Database::getInstance();

		// delete session
		$res = $db->exec('DELETE FROM `sessions` WHERE id = ?', $sid);

		// unset all persistent states
		$app->unsetAllPersistentStates();

		// unset RememberMe
		$app->currentUser->unsetRememberMe();
		
		// reset the user in Application object
		$app->currentUser = NULL;
		
		return (bool)$res;
	
	}
public static function doLogout($sid): bool {

		$app = Application::getInstance();
		$db  = Database::getInstance();

		// delete session
		$res = $db->exec('DELETE FROM `sessions` WHERE id = ?', $sid);

		// unset all persistent states
		$app->unsetAllPersistentStates();

		// unset RememberMe
		$app->currentUser->unsetRememberMe();
		
		// reset the user in Application object
		$app->currentUser = NULL;
		
		return (bool)$res;
	
	}
public static function doLogout ( $ sid ) : bool { $ app = Application :: getInstance ( ) ; $ db = Database :: getInstance ( ) ; // delete session $ res = $ db -> exec ( 'DELETE FROM `sessions` WHERE id = ?' , $ sid ) ; // unset all persistent states $ app -> unsetAllPersistentStates ( ) ; // unset RememberMe $ app -> currentUser -> unsetRememberMe ( ) ; // reset the user in Application object $ app -> currentUser = NULL ; return ( bool ) $ res ; }
Does the logout action and returns TRUE if session is found and deleted.

@param	string	Session ID to close.

@return	bool
Does the logout action and returns TRUE if session is found and deleted .