complete user login and logout