public static String getCookieData(Cookie[] cookies, String key) {
        String value = null;
        if (cookies != null && key != null) {
            for (Cookie cookie : cookies) {
                if (StringUtils.equals(cookie.getName(), key)) {
                    value = cookie.getValue();
                }
            }
        }
        return value;
    }