eclipse-ee4j / eclipse-ee4j/jersey

Jersey Client send Cookie with ',' separator, who is deprecated

Open
#2,811 5 comments 0 reactions 0 assignees View on GitHub
Client Component: core cookies Priority: Major Type: Bug
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Hi,

I use WebResourceFactory to create a resource for my client :

WebResourceFactory.newResource(MyResource.class, client.target(url))

I have a method with cookies in my resource:

String notification(@CookieParam("session_id") long sessionId, @CookieParam("session_token") String sessionToken,
String notification);

Then cookies are sent with a "," separator. Who seems to be an obsolete RFC (2965 vs 6265)

You can see new RFC here : [http://tools.ietf.org/html/rfc6265#section-4.1](http://tools.ietf.org/html/rfc6265#section-4.1)

Discution on spray project here : [https://github.com/spray/spray/issues/869](https://github.com/spray/spray/issues/869)

I try to path jersey by myself to submit a PR, but it can't compile on my computer :

```
diff --git i/core-client/src/main/java/org/glassfish/jersey/client/HttpUrlConnector.java w/core-client/src/main/java/org/glassfish/jersey/client/HttpUrlConnector.java
index b32d8a6..db289c2 100644
--- i/core-client/src/main/java/org/glassfish/jersey/client/HttpUrlConnector.java
+++ w/core-client/src/main/java/org/glassfish/jersey/client/HttpUrlConnector.java
@@ -351,7 +351,7 @@ class HttpUrlConnector implements Connector {
boolean add = false;
for (Object value : headerValues) {
if (add) {
- b.append(',');
+ b.append(';');
}
add = true;
b.append(value);
```

So, I'm not sure there is no side effect.
#### Affected Versions
[2.9]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.