public static List<Cookie> fromCookieHeader(String headerVal) {
        var cookies = new ArrayList<Cookie>();
        var parser = CookieParser.newParser(
                (name, value, version, domain, path, comment) -> {
                    var cookie = new Cookie();
                    cookie.setName(name);
                    cookie.setValue(value);
                    cookie.setDomain(domain);
                    cookie.setPath(path);
                    cookies.add(cookie);
                },
                CookieCompliance.RFC6265, ComplianceViolation.Listener.NOOP
        );
        parser.parseField(headerVal);
        return List.copyOf(cookies);
    }
A RFC 6265 compliant cookie.

Note: RFC 2109 and RFC 2965 is no longer supported. All fields that are not part of RFC 6265 are deprecated.

@author Einar M R Rosenvinge
@author bjorncs
container-core/src/main/java/com/yahoo/jdisc/http/Cookie.java