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

Add support for SamSite cookie attribute #1376

Open
wants to merge 2 commits into
base: 2.4
Choose a base branch
from

Conversation

PSpSynedra
Copy link

This pull request adds support for the SameSite cookie attribute to:

  • org.restlet.data.CookieSetting
  • org.restlet.engine.header.CookieSettingWriter
  • org.restlet.engine.header.CookieSettingReader

It also adds tests for the added functionality via:

  • org.restlet.test.engine.header.CookieSettingReaderTestCase
  • org.restlet.test.engine.header.CookieSettingWriterTestCase

According to the description of SameSite cookies on MDN [1] the SameSite cookie attribute controls in requests a cookie is included in.
The absence of the SameSite attribute might trigger warnings in modern browsers.
Some browsers might event reject cookies with missing or wrongly set SameSite attributes.

Some scenarios might also require the SameSite attribute to be Strict so the corresponding cookie is only being sent in requests initiated by the same site.

The changes in modules/org.restlet.test/pom.xml where necessary for eclipse to match the packages with the folder structure.

[1] - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite

@thboileau
Copy link
Contributor

thboileau commented Jan 6, 2024

Hi @PSpSynedra
Thanks a lot for your contribution!
As a first-time contributor, do you mind to sign this JCA return it to [email protected] ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants