complete login and logout procedures