code: def is_cookie_in_driver(self, cookie):
          
          for driver_cookie in self.get_cookies():
              if (cookie['name'] == driver_cookie['name'] and
                  cookie['value'] == driver_cookie['value'] and
                  (cookie['domain'] == driver_cookie['domain'] or
                   '.' + cookie['domain'] == driver_cookie['domain'])):
                  return True
          return False
docs: We check that the cookie is correctly added to the driver
  
          We only compare name, value and domain, as the rest can produce false negatives.
          We are a bit lenient when comparing domains.