Re: http_cookie_set and http_cookie_remove

From: Date: Sun, 23 Jul 2017 18:26:52 +0000
Subject: Re: http_cookie_set and http_cookie_remove
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-100021@lists.php.net to get a copy of this message
Hello Andrey,
That's what I was afraid of, and what I suggested be changed. If we had a similar, array-of-attributes API that did NOT ignore or trigger warnings for unknown attributes, everybody using PHP would've been able to use SameSite already.
I think it is necessary to trigger a notice or warning for unknown options for troubleshooting.
On another note, I'd also move the 'expire' option to a separate parameter and remove $options to $attributes. 'expire' is not a known cookie attribute; PHP uses it to calculate the Expires and Max-Age attributes ...
The "attribute" expires (not expire) existing in the header Set-Cookie.
I liked your proposal, because it's a chance to have a shiny new API that doesn't come with all the legacy stuff already built into setcookie().
I hope to meet your expectations.
But if we want an array-based setcookie() alternative without changing anything else, we can just change setcookie() to accept arrays.
No this is just the only the first step for additional extensions.

« previous php.internals (#100021) next »