Use $app->setUserState