complete login and logout.