@Override
    public boolean match(final Cookie cookie, final CookieOrigin origin) {
        Args.notNull(cookie, "Cookie");
        Args.notNull(origin, "Cookie origin");
        final String host = origin.getHost();
        String domain = cookie.getDomain();
        if (domain == null) {
            return false;
        }
        if (domain.startsWith(".")) {
            domain = domain.substring(1);
        }
        domain = domain.toLowerCase(Locale.ROOT);
        if (host.equals(domain)) {
            return true;
        }
        if ((cookie.containsAttribute(Cookie.DOMAIN_ATTR))) {
            return domainMatch(domain, host);
        }
        return false;
    }
Cookie {@code domain} attribute handler.

@since 4.0
ngrinder-runtime/src/main/java/org/apache/hc/client5/http/impl/cookie/BasicDomainHandler.java