Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96521 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65283 invoked from network); 20 Oct 2016 12:21:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Oct 2016 12:21:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.219 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.219 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.219] ([81.169.146.219:28561] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/B7-24564-2B6B8085 for ; Thu, 20 Oct 2016 08:21:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1476966063; l=4369; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=ZgJ0YTmN1+nKafJyVw7Qy04F/qhPg0bktHPsOLrMJyo=; b=xnEl7E4r/XKqUNbtF9wAJmZuz864yszwFcX5PpTP0AHYOPiGM5PXmCXLo+4Hn5FVKGb QL7Uo6+awl7b+aLO3MuZi72WS86rFhDnW9e9e//gxHYWh9AXZsWVCWlhHM09+s1LM6C1i y+Ozq60jDC9ShvnXWoX+NY4YKRJ/dqi3mwU= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoBPBqD+ud8= X-RZG-CLASS-ID: mo00 Received: from mail-qk0-f169.google.com ([209.85.220.169]) by smtp.strato.de (RZmta 39.6 AUTH) with ESMTPSA id 9051d8s9KCL38UZ (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Thu, 20 Oct 2016 14:21:03 +0200 (CEST) Received: by mail-qk0-f169.google.com with SMTP id z190so90344293qkc.2 for ; Thu, 20 Oct 2016 05:21:03 -0700 (PDT) X-Gm-Message-State: ABUngvfurqrA6gY4C+fHoAsxFrtVXvUkdHktEKSS8XO1UP+vE5+G9ZVaiaaTaE+j3rdnY3v5QKEQjFOefEZ+fw== X-Received: by 10.194.166.232 with SMTP id zj8mr223160wjb.225.1476966062528; Thu, 20 Oct 2016 05:21:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.177.153 with HTTP; Thu, 20 Oct 2016 05:21:01 -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: Thu, 20 Oct 2016 14:21:01 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Yasuo Ohgaki Cc: Stephen Reay , Stanislav Malyshev , "internals@lists.php.net" , Davey Shafik , Xinchen Hui Content-Type: multipart/alternative; boundary=089e01227ab080a16f053f4af56d Subject: Re: [PHP-DEV] header() removes all header of the same name. From: me@kelunik.com (Niklas Keller) --089e01227ab080a16f053f4af56d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2016-10-20 13:41 GMT+02:00 Yasuo Ohgaki : > Hi Stephen, > > On Thu, Oct 20, 2016 at 8:24 PM, Stephen Reay > wrote: > > The *only* solution that retains full control for the developer, is no > > change. Any =E2=80=9Cmagic=E2=80=9D about =E2=80=9Cuntouchable=E2=80=9D= cookie headers (e.g. forcing the > > session cookie header after userland cookie headers) takes away options > for > > the developer. > > My cookie*() functions proposal allows developers to remove header by > cookie_remove() and can send any cookie header by cookie_custom(). > Therefore, developers have full control if they have to. > > The only pain is that users may have to use cookie*() functions if we > disallow header('Set-Cookie') which will be a vote option. If there is > fully functional cookie*() functions, it will mitigate wrong > header('Set-Cookie') usage regardless of the vote result, hopefully. > What about extensions to the `set-cookie` header? Take `SameSite` as a recent example. The `setcookie` API doesn't cover that. Besides that, the current `setcookie` API is awful, people just added more and more parameters. 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/9a7327f062aa678408dfe4f4c3c7f479db16f18= 7/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. Regards, Niklas --089e01227ab080a16f053f4af56d--