Re: [RFC] Add SameSite cookie attribute parameter
| From: | Christian Schneider | Date: | Tue, 17 Jan 2023 15:38:20 +0000 |
| Subject: | Re: [RFC] Add SameSite cookie attribute parameter | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119293@lists.php.net to get a copy of this message | ||
Am 17.01.2023 um 15:59 schrieb G. P. B. <george.banyard@gmail.com>:
> Side-Note: Isn't SameSite a very generic name in the global namespace? I'm not sure
> what the PHP policy is here.
>
> AFAIK the global namespace is "owned" by PHP so that shouldn't be an issue per
> the usual policy.
In a quick check I could not find any other Enums defined in the core. Would this be the first one?
I guess I was comparing it to constants where in most cases the constant name reflects where it is
used, e.g. STR_PAD_LEFT and I was therefore wondering whether the name SameSite should somehow
contain cookie in one form or another. Or is this frowned upon for Enums?
> Are there any Enums in core PHP APIs where new values could be added in the future and how is
> the plan for code supporting multiple PHP version there? This was just something which crossed my
> mind when thinking about APIs with Enums. This is not really related to this RFC so I understand if
> you want to ignore this part :-)
>
> I might be again misunderstanding, but one cannot extend an enum as they are final classes
> under the hood.
> Currently, the only other native enum is the one that was added with the Randomizer Additions
> RFC [1] so this topic hasn't come up yet as the enum for ext-random is definetely complete.
I'm talking about adding new values in later PHP versions, let's for example assume they
would add a SameSite mode "Stricter" and PHP wants to support that.
How would one write code to use "Stricter" in code meant to work for both old and new PHP
versions?
- Chris