private void processCookies(
            final String exchangeId,
            final Iterator<Header> iterator,
            final CookieSpec cookieSpec,
            final CookieOrigin cookieOrigin,
            final CookieStore cookieStore) {
        while (iterator.hasNext()) {
            final Header header = iterator.next();
            try {
                final List<Cookie> cookies = cookieSpec.parse(header, cookieOrigin);
                for (final Cookie cookie : cookies) {
                    try {
                        cookieSpec.validate(cookie, cookieOrigin);
                        cookieStore.addCookie(cookie);

                        if (LOG.isDebugEnabled()) {
                            LOG.debug("{} Cookie accepted [{}]", exchangeId, formatCookie(cookie));
                        }
                    } catch (final MalformedCookieException ex) {
                        if (LOG.isWarnEnabled()) {
                            LOG.warn("{} Cookie rejected [{}] {}", exchangeId, formatCookie(cookie), ex.getMessage());
                        }
                    }
                }
            } catch (final MalformedCookieException ex) {
                if (LOG.isWarnEnabled()) {
                    LOG.warn("{} Invalid cookie header: \"{}\". {}", exchangeId, header, ex.getMessage());
                }
            }
        }
    }
Default instance of {@link ResponseProcessCookies}.

@since 5.2
httpclient5/src/main/java/org/apache/hc/client5/http/protocol/ResponseProcessCookies.java