starlette icon indicating copy to clipboard operation
starlette copied to clipboard

Sessions cookie changes to support persistent cookies and partitioned cookies

Open ToasterChicken opened this issue 1 year ago • 5 comments

  • Issues #2019 Added same_site for CHIPS cookie support
  • Discussion #2441 cookies are missing the partitioned option.

Updated Documentation for changes Updated Unit Test to include both new SessionsMiddleware features.

Summary

Added cookie persistence to the sessions middleware so the cookie isn't refreshed on every request for issue #2019

Clarified the security regarding the session cookie, that it is not encrypted and not considered private but is not modifiable.

Added the partitioned cookies flag for the cookies to support CHIPS (Cookies Having Independent Partitioned State) to support cookies being set in iframes if the middleware being used to set a 3rd party cookie for a different top level site. Discussion #2441

Checklist

  • [ X] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • [ X] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • [ X] I've updated the documentation accordingly.

ToasterChicken avatar Feb 24 '24 12:02 ToasterChicken