elixir-plug / plug

Compose web applications with functions
https://hex.pm/packages/plug
Other
2.81k stars 578 forks source link

Add support for Partitioned cookie attribute #1225

Closed sneako closed 1 month ago

sneako commented 1 month ago

Add support for Partitioned cookie attribute

This attribute is used for partitioned cookies, aka Cookies Having Independent Partitioned State (CHIPS).

This is a new feature being developed by Chrome/Chromium which was enabled by default starting in version 114 (current latest version is 126).

The goal of this feature is to allow third party cookies without allowing these third parties to track users across domains.

https://developers.google.com/privacy-sandbox/3pcd/chips https://developer.mozilla.org/en-US/docs/Web/Privacy/Privacy_sandbox/Partitioned_cookies

Do the Plug maintainers think this feature is stable/supported enough for adoption by Plug?

josevalim commented 1 month ago

Hi @sneako!

We typically only adopt features once they have been a standard accept by all browsers, because they tend to change (sometimes quite a lot) until they get standardized. Could you use the :extra option when setting the cookie meanwhile? https://hexdocs.pm/plug/Plug.Conn.html#put_resp_cookie/4-options

sneako commented 1 month ago

Ahh yes, sorry I missed the :extra option that handles this perfectly for us. Definitely makes sense to wait, thank you!