Implemented the login/logout/newuser features