Completes login/logout.