mirror of
https://github.com/moodle/moodle.git
synced 2025-03-19 23:20:09 +01:00
To opt a cookie in to Chrome's 3rd party cookie partitioning solution, CHIPS, the property 'Partitioned;' needs to be set. This adds a helper class supporting this, for a given cookie(s). Note also, PHP's native cookie APIs (setcookie, etc) don't support this cookie property yet - (https://github.com/php/php-src/issues/12646). Since this class is intended to allow existing Set-Cookie headers to be modified before being sent (e.g. allowing clients to set a property on a cookie set elsewhere in code), it deals with the headers directly anyway but it means that new cookies must also use this helper to opt-in, instead of relying on setcookie(). E.g. where the intent is to add partitioning support to a new cookie, that cookie must first be set (setcookie) and then it may opt-in to partitioning via this helper; partitioning support cannot be achieved directly through setcookie and friends yet.