Cookie[] cookies = matcher.match(conn.getHost(), conn.getPort(),
getPath(), conn.isSecure(), state.getCookies());
if ((cookies != null) && (cookies.length > 0)) {
if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {
// In strict mode put all cookies on the same header
String s = matcher.formatCookies(cookies);
getRequestHeaderGroup().addHeader(new Header("Cookie", s, true));
} else {
// In non-strict mode put each cookie on a separate header
for (int i = 0; i < cookies.length; i++) {
String s = matcher.formatCookie(cookies[i]);