def is_cookie_in_driver(self, cookie: dict[str, Any]) -> bool:
        """
        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.
        """
        for driver_cookie in self.get_cookies():
            name_matches = cookie["name"] == driver_cookie["name"]
            value_matches = cookie["value"] == driver_cookie["value"]
            domain_matches = driver_cookie["domain"] in (cookie["domain"], "." + cookie["domain"])
            if name_matches and value_matches and domain_matches:
                return True
        return False

        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.
        
requestium/requestium_mixin.py