Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78556 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24843 invoked from network); 2 Nov 2014 00:33:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Nov 2014 00:33:42 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:56360] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/61-13276-FDB75545 for ; Sat, 01 Nov 2014 19:33:36 -0500 Received: by mail-wi0-f172.google.com with SMTP id bs8so3880063wib.17 for ; Sat, 01 Nov 2014 17:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=CV59zWQxCUV1J8VV6XLzRVzuePTIhrMlOcNAirmBoMo=; b=WqSuVu/TZ4pOEcuCWFA91agOsF83tfMeqPxyyuvmDYPWP8KfGjE64+ECW3dzqGjDRf lxWkxk6cNUSRDZbMWmUTLHVk72rQdr+st3flIhPOw5LcrxryH8lvI1KGvHKOPORD1rx1 fVFi8K0NLh+tJCUOLTRE/Zbvb0GXNVYjgsHH6yTMeSXFVHMwZmvZuxRVJpNDPQQfYS3j zCGU1NioLtjZ4Y12InOxMkEsGjhh05Ol/diTqs+F/pHDBeNxbSTDyT5qr4F5Z41kmlET xpa+hgEEZ0sHp8Z5uMa89vyMILOkC9x90rUEHg6ItG0xekQe9NOwcTbNQ/YszMuzsz3b Zh4g== X-Received: by 10.194.133.229 with SMTP id pf5mr38573505wjb.73.1414888410821; Sat, 01 Nov 2014 17:33:30 -0700 (PDT) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id l4sm13475812wjx.14.2014.11.01.17.33.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Nov 2014 17:33:30 -0700 (PDT) Message-ID: <54557BCE.1070405@gmail.com> Date: Sun, 02 Nov 2014 00:33:18 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <545554F7.70906@gmail.com> <581CB00C-59B7-4263-8533-D7DCB54C806E@ajf.me> In-Reply-To: <581CB00C-59B7-4263-8533-D7DCB54C806E@ajf.me> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] setcookie() minor BC break - fixes issue #67736 From: rowan.collins@gmail.com (Rowan Collins) 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]