finish login/logout