Implemented user login and logout