finishes login/logout