Finsih login and logout.