log.logInfo("Cookie name: "+cookies[i].getName()); if (cookies[i].getName().equals(cookieName)) { log.logInfo("Found cookie; value is "+ cookies[i].getValue());
if (cookies[i].getName().equals(cookieName))
    public static String getCookieValue(final String cookieName, final Cookie[] cookies)    throws IllegalArgumentException {        // Sanity checks.        if (cookieName == null || cookieName.equals(""))            throw new IllegalArgumentException("Cookie name must be a non-empty string");        if (cookies == null)            return null;        // Return cookie value, if set.        String value = null;        for (int i = 0; i < cookies.length; i++) {            log.logInfo("Cookie name: "+cookies[i].getName());            if (cookies[i].getName().equals(cookieName)) {                log.logInfo("Found cookie; value is "+ cookies[i].getValue());                value = cookies[i].getValue();            }        }        return value;    }