Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96532 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8139 invoked from network); 21 Oct 2016 00:36:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Oct 2016 00:36:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:47846] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/6D-24564-22369085 for ; Thu, 20 Oct 2016 20:36:52 -0400 Received: (qmail 10672 invoked by uid 89); 21 Oct 2016 00:36:47 -0000 Received: from unknown (HELO mail-qt0-f174.google.com) (yohgaki@ohgaki.net@209.85.216.174) by 0 with ESMTPA; 21 Oct 2016 00:36:47 -0000 Received: by mail-qt0-f174.google.com with SMTP id m5so71923442qtb.3 for ; Thu, 20 Oct 2016 17:36:46 -0700 (PDT) X-Gm-Message-State: ABUngvd/jEsMXd0nuZi0GjMCBHAUrg3maDeKyQrK+I1RcSTBikIqP4LO5aQwMcQV0BJ8qRtw4B+6RctFbFTWzA== X-Received: by 10.200.54.144 with SMTP id a16mr2962669qtc.126.1477010200538; Thu, 20 Oct 2016 17:36:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.22.38 with HTTP; Thu, 20 Oct 2016 17:35:59 -0700 (PDT) In-Reply-To: References: <1eab7492-596c-ffd2-81ed-0eb9256a033e@gmail.com> <0B722A15-A29F-498B-987F-F6BA5AA49EEF@bobs-bits.com> <59D6B40B-DC64-43A3-AED4-CD5C9C15B6BA@koalephant.com> Date: Fri, 21 Oct 2016 09:35:59 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Niklas Keller Cc: Stephen Reay , Stanislav Malyshev , "internals@lists.php.net" , Davey Shafik , Xinchen Hui Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] header() removes all header of the same name. From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Niklas and all, On Thu, Oct 20, 2016 at 9:21 PM, Niklas Keller wrote: > Before we even discuss disallowing `header("set-cookie")`, we should have a > sane cookie API, e.g. one that like `setcookie($name, $value, $flags)`. > > That's also the way we implemented it in Aerys > (https://github.com/amphp/aerys/blob/9a7327f062aa678408dfe4f4c3c7f479db16f187/lib/Response.php#L49-L58). > It's a simple wrapper around `addHeader` to make life easier, but it doesn't > restrict developers to call `setHeader` and replace all `set-cookie` > headers. We choose current API for reason. It does not look pretty. This is patch allow array config for 3rd param for setcookie(). https://gist.github.com/yohgaki/b86e07cd450777422c1a467166cd2fd3 I suppose some of us will have opinions having this kind of code(s). Any comments? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net