Working login/logout sequence.