metro-jax-ws
                                
                                 metro-jax-ws copied to clipboard
                                
                                    metro-jax-ws copied to clipboard
                            
                            
                            
                        Problem with Cookie handling
Hi,
with jaxws-rt versions 3.0.2 and 4.0.0 I observed a problem with a stateful SOAP client, which I activated using
((BindingProvider) mySoapClient).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);
With the first call my soap client got multiple cookies from the server like this:
set-cookie: cookie1=val1; version="1"; path=/cgi-bin/path...
set-cookie: cookie2=val2; version="1"; path=/cgi-bin/path...
In the subsequent call my SOAP client now sends these cookies this way:
Cookie: $Version="1"
Cookie: cookie2="val2";$Path="/cgi-bin/path...";$Domain="localhost.local"
Cookie: cookie1="val1";$Path="/cgi-cgi-bin/path...";$Domain="localhost.local"
which (afaik) is wrong in 2 ways:
- There must be only one single "Cookie" header, according to https://datatracker.ietf.org/doc/html/rfc6265#section-5.4
- Further attributes in set-cookie like "Path" are not meant to be sent back to the server
The former jaxws implementation which was part of Java 8 did work fine. So this is preventing me from Upgrading to Java 11 or newer.
Regards