Allows user to login log out and knows if the user is logged in