[ 
https://issues.apache.org/jira/browse/CXF-9087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17903955#comment-17903955
 ] 

Andriy Redko commented on CXF-9087:
-----------------------------------

Hi [~dsylaiev] ,

So the Cookie class comes from JAX-RS specification (and is not part of CXF 
codebase), it sets the version to "1" by default. If this is not what you need, 
please be explicit (by setting the version to 0):
 

wc.cookie(new Cookie("a", "1", null, null, 0));
wc.cookie(new Cookie("b", "2", null, null, 0));

Regarding, the cookie value pair separator, it seems to be more complicated. 
Could you please share what JDK version / vendor you are using and what HTTP 
conduit you are using? (sharing CXF dependencies may help to figure it our 
quickly). Thank you.


 

> AbstractClient::cookie method creates incorrect Cookie header
> -------------------------------------------------------------
>
>                 Key: CXF-9087
>                 URL: https://issues.apache.org/jira/browse/CXF-9087
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.5.9
>            Reporter: Dmytro Sylaiev
>            Priority: Minor
>
> When executing this code:
> {noformat}
> WebClient webClient = WebClient.create(url);
> webClient.cookie(new javax.ws.rs.core.Cookie("a", "1"));
> webClient.cookie(new javax.ws.rs.core.Cookie("b", "2"));
> webClient.invoke("GET", null);{noformat}
> the WebClient would invoke an HTTP request with the next Cookie header:
> {noformat}
> Cookie: $Version=1;1=2, $Version=1;2=3{noformat}
> which is against the RFC 6265, where multiple cookies should be separated by 
> a semicolon, not a comma, and doesn't include $Version in the Cookie header
>  
> when using Postman, the header on the client request is
> {noformat}
> Cookie: 1=2; 2=3{noformat}
> and seems it is the expected result for AbstractClient as well.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to