On 01/11/2014 22:24, Andrea Faulds wrote:
Perhaps it would be worth ditching any attempts to change setcookie() (just
keep it around for backwards-compatibility), and to instead add a new function,
function family, or indeed class for cookie handling. Some sort of sane API
which would allow you to do a, b, or c, and make it clear which you wanted.
Thoughts? Any idea what such an API might look like?
That rather brings us back to this week's Hot Topic: HTTP response
objects, pecl/http, and PSR-7.
pecl/httpv2 has the http\Cookie class [1], which confusingly represents
not a single cookie, but a whole set of cookies. Exactly how you attach
this to a response is not really clear from the docs I can find.
The current PSR-7 draft [2] appears to be lacking any direct support for
setting cookies, and mentions them only in the context of
Psr\Http\Message\IncomingRequestInterface. Perhaps someone who has been
following that discussion will be able to clarify why cookie handling
functions were not considered in scope for
Psr\Http\Message\ResponseInterface.
[1] http://devel-m6w6.rhcloud.com/mdref/http/Cookie
[2]
https://github.com/php-fig/fig-standards/blob/master/proposed/http-message.md
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php