Handling login/relogin when server is changed.