-
Bug
-
Resolution: Done
-
Major
-
3.0.2.Final
-
None
Using max-age on cookies trigger Jetty to forcibly add "Expires" attribute to the Cookie.
The problem is that NewCookieHeaderDelegate does not recognize the "Expires" header, which break parsing of the cookie entirely.
- Example request from the client:
Builder builder = ClientBuilder.newClient().target(uri).request();
Response response = builder.buildGet().invoke();
- HTTP response from the server:
Set-Cookie: guid=1.9112608617070927872;Path=/;Domain=localhost;Expires=Thu, 03-May-2018 10:36:34 GMT;Max-Age=150000000
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Length: 0
Server: Jetty(9.0.4.v20130625)
- Printing cookies results in:
for (String key : response.getCookies().keySet()) {
System.out.println("[" + key + "]=[" + response.getCookies().get(key) + "]");
}
[03-May-2018 10:46:21 GMT]=[03-May-2018 10:46:21 GMT=;Version=1;Domain=localhost;Path="/";Max-Age=150000000]