if (cookies != null) { for (int i = 0; i < cookies.length; i++) { if (cookies[i].getName().equals(cookieName)) { value = cookies[i].getValue(); }
for (int i = 0; i < cookies.length; i++) { if (cookies[i].getName().equals(cookieName)) { value = cookies[i].getValue();
    public static String getCookieValue(final String cookieName, final Cookie[] cookies) {        /* Validate parameters. */        if (cookieName == null || cookieName.equals("")) {            throw new IllegalArgumentException("cookieName must be a non-empty string");        }        if (cookies == null) {            throw new IllegalArgumentException("cookies cannot be null");        }        String value = null;        if (cookies != null) {            for (int i = 0; i < cookies.length; i++) {                if (cookies[i].getName().equals(cookieName)) {                    value = cookies[i].getValue();                }            }        }        return value;    }