Finish login and logout.