Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow RFC6265 Cookies to include optional SameSite attribute. #3040

Closed
joakime opened this issue Oct 30, 2018 · 8 comments
Closed

Allow RFC6265 Cookies to include optional SameSite attribute. #3040

joakime opened this issue Oct 30, 2018 · 8 comments
Labels
Enhancement Specification For all industry Specifications (IETF / Servlet / etc)

Comments

@joakime
Copy link
Contributor

joakime commented Oct 30, 2018

Per https://tools.ietf.org/html/draft-west-first-party-cookies-07
and https://caniuse.com/#search=samesite

There is a new "SameSite" attribute that the Set-Cookie syntax which allows servers to assert that a cookie ought not to be sent along with cross-site requests.

@joakime
Copy link
Contributor Author

joakime commented Oct 30, 2018

Currently, there's 3 defined values present in the draft spec "None", "Strict", and "Lax".

Evaluate if we would need to update org.eclipse.jetty.http.HttpCookie to include this information.
Should this be a setting that applications can use?
Can this be configured as a ServletContext attribute? (possibly values: "Excluded", "None", "Strict", "Lax")?

@joakime
Copy link
Contributor Author

joakime commented Oct 30, 2018

This could also become a CookieCompliance configurable behavior for the ServerConnector.

@joakime joakime added Low Priority Specification For all industry Specifications (IETF / Servlet / etc) labels Mar 22, 2019
@BruceMacD
Copy link
Contributor

I've been working on some SameSite behavior in Jetty due to the upcoming changes in Google Chrome. If there is interest I could add some tests to my implementation and can provide a pull request. My current implementation updates the org.eclipse.jetty.http.HttpCookie and org.eclipse.jetty.server.Response.addSetRFC6265Cookie().

I have the default behavior to exclude the specifier by default due to some unexpected browser behaviors [1].

Let me know if there would be any more expectations here.

[1] https://bugs.webkit.org/show_bug.cgi?id=198181

@sbordet
Copy link
Contributor

sbordet commented Aug 7, 2019

@BruceMacD a PR would be great.

BruceMacD pushed a commit to BruceMacD/jetty.project that referenced this issue Aug 9, 2019
BruceMacD added a commit to BruceMacD/jetty.project that referenced this issue Aug 9, 2019
BruceMacD added a commit to BruceMacD/jetty.project that referenced this issue Aug 9, 2019
… attribute

Signed-off-by: Bruce MacDonald <brucewmacdonald@gmail.com>
@joakime
Copy link
Contributor Author

joakime commented Aug 9, 2019

Note: javax.servlet.http.Cookie does not support this extra attribute as well.
Should perhaps also add an issue at https://github.com/eclipse-ee4j/servlet-api for this. (it might be possible to have it show up in a release as early as Jakarta EE 9)

The CookieCompliance class should be updated to allow HttpConfiguration based control of this SameSite behavior.
(Possibly similar to how HttpCompliance operates)

@joakime
Copy link
Contributor Author

joakime commented Aug 12, 2019

The title references https://tools.ietf.org/html/rfc6265
But that RFC doesn't have the SameSite attribute.

gregw pushed a commit that referenced this issue Aug 20, 2019
…ibute

Signed-off-by: Bruce MacDonald <brucewmacdonald@gmail.com>
@gregw gregw closed this as completed Aug 20, 2019
@sparklton
Copy link

It works good, but what about the JSESSIONID cookie? This cookie is created internally by Jetty somewhere, how do we make it include the SameSite requirements as well. I see warnings in Chrome browsers about this.

@joakime
Copy link
Contributor Author

joakime commented Oct 28, 2019

@sparklton i opened Issue #4247 to discuss this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Specification For all industry Specifications (IETF / Servlet / etc)
Projects
None yet
Development

No branches or pull requests

5 participants