def transfer_session_cookies_to_driver(self, domain: str | None = None) -> None:
        """
        Copy the Session's cookies into the webdriver.

        Using the 'domain' parameter we choose the cookies we wish to transfer, we only
        transfer the cookies which belong to that domain. The domain defaults to our last visited
        site if not provided.
        """
        if not domain and self._last_requests_url:
            domain = tldextract.extract(self._last_requests_url).top_domain_under_public_suffix

        if not domain:
            msg = "Trying to transfer cookies to selenium without specifying a domain and without having visited any page in the current session"
            raise InvalidCookieDomainException(msg)

        # Transfer cookies
        for c in [c for c in self.cookies if domain in c.domain]:
            cookie = {"name": c.name, "value": c.value, "path": c.path, "expiry": c.expires, "domain": c.domain}

            self.driver.ensure_add_cookie({k: v for k, v in cookie.items() if v is not None})

        Copy the Session's cookies into the webdriver.

        Using the 'domain' parameter we choose the cookies we wish to transfer, we only
        transfer the cookies which belong to that domain. The domain defaults to our last visited
        site if not provided.
        
requestium/requestium_session.py