Working login/logout flow