Can't add more than one cookie with the same name
Issue
- We have two cookies with the same name, but different paths. One of the headers is being ignored. According to https://javaee.github.io/javaee-spec/javadocs/javax/servlet/http/Cookie.html it should be possible to have multiple cookies with the same name but different paths
javax.servlet.http.Cookie c = new javax.servlet.http.Cookie("test", "test");
c.setPath("/test");
javax.servlet.http.Cookie cc = new javax.servlet.http.Cookie("test", "test");
cc.setPath("/test2");
response.addCookie(c);
response.addCookie(cc);
- Where cookies have the the same name, and path, but different domains, they are ignored. Per https://tools.ietf.org/html/rfc6265#section-5.3 it shouldn't
Cookie cookie1 = new Cookie("cookie1", "value1");
cookie1.setDomain("*.cookie1.com");
Cookie cookie1_1 = new Cookie("cookie1", "value1_1");
cookie1_1.setDomain("*.cookie1_1.com");
Cookie cookie2 = new Cookie("cookie2", "value2");
cookie2.setDomain("*.cook2.com");
resp.addCookie(cookie1);
resp.addCookie(cookie1_1);
resp.addCookie(cookie2);
- We hit the issue UNDERTOW-1489 and JBEAP-16298 and need a fix from Red Hat
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.1, 7.2
- cookie with same name but different paths
- cookie with same name but different domains
- 7.1, 7.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.