restlet-framework-java icon indicating copy to clipboard operation
restlet-framework-java copied to clipboard

Add support for SamSite cookie attribute

Open PSpSynedra opened this issue 4 years ago • 1 comments

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

PSpSynedra avatar Oct 22 '20 14:10 PSpSynedra

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] ?

thboileau avatar Jan 06 '24 14:01 thboileau