public static Cookie getCookie(final Iterable<Cookie> cookies, final String name) {
        if (cookies != null) {
            for (val cookie : cookies) {
                if (cookie != null && StringUtils.equals(name, cookie.getName())) {
                    return cookie;
                }
            }
        }
        return null;
    }
Get a specific cookie by its name.

@param cookies provided cookies
@param name the name of the cookie
@return the cookie
pac4j-core/src/main/java/org/pac4j/core/context/WebContextHelper.java