Correct behavior when logging in and out