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;
	
	}