diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java b/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java index 28e2b4f2f..de00b6bfd 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/LaxExpiresHandler.java @@ -214,7 +214,7 @@ public class LaxExpiresHandler extends AbstractCookieAttributeHandler implements @Override public String getAttributeName() { - return ClientCookie.MAX_AGE_ATTR; + return ClientCookie.EXPIRES_ATTR; } } diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java index 8640eef74..3e8e63c00 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/RFC6265CookieSpec.java @@ -151,7 +151,8 @@ public class RFC6265CookieSpec implements CookieSpec { final Map attribMap = new LinkedHashMap(); while (!cursor.atEnd()) { - final String paramName = tokenParser.parseToken(buffer, cursor, TOKEN_DELIMS); + final String paramName = tokenParser.parseToken(buffer, cursor, TOKEN_DELIMS) + .toLowerCase(Locale.ROOT); String paramValue = null; if (!cursor.atEnd()) { final int paramDelim = buffer.charAt(cursor.getPos()); @@ -163,7 +164,7 @@ public class RFC6265CookieSpec implements CookieSpec { } } } - cookie.setAttribute(paramName.toLowerCase(Locale.ROOT), paramValue); + cookie.setAttribute(paramName, paramValue); attribMap.put(paramName, paramValue); } // Ignore 'Expires' if 'Max-Age' is present