Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96513 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49037 invoked from network); 20 Oct 2016 10:39:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Oct 2016 10:39:13 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.163 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.163 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.163] ([81.169.146.163:39805] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/64-24564-ACE98085 for ; Thu, 20 Oct 2016 06:39:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1476959943; l=4870; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=p2/DgFG3bOqmCcpUGsaxvg3wggluFJ9soUwQHaDoX4o=; b=wYKibCgcUEmugqnb6zFRo5Rr5ESZJbbs324BkvkTU4fqpWPKRGhD81w6W3EJklHCdFW n6JBkySBIamiU2DB/O/w7oFwGSQCrBoYUazhK4mpb6DGIyXkKeEMGMQZ37r1kWKoP9fBT 3EEN8ihBx360RH29GsjVodshkbTz0CWKRq8= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoNJBqD/sAU= X-RZG-CLASS-ID: mo00 Received: from mail-qt0-f170.google.com ([209.85.216.170]) by smtp.strato.de (RZmta 39.6 AUTH) with ESMTPSA id q09c78s9KAd3U8t (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 12:39:03 +0200 (CEST) Received: by mail-qt0-f170.google.com with SMTP id m5so47404351qtb.3 for ; Thu, 20 Oct 2016 03:39:03 -0700 (PDT) X-Gm-Message-State: AA6/9RlRuL3uoXRoDEVOLtwKgYkH0M/LA/0H3YLTSS1QTGKQsqkZ2ytK5XMksS97Qdq5/T4c284aMTooZ8gtAg== X-Received: by 10.28.199.75 with SMTP id x72mr5545744wmf.35.1476959942673; Thu, 20 Oct 2016 03:39:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.177.153 with HTTP; Thu, 20 Oct 2016 03:39:02 -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 12:39:02 +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=94eb2c0d7e8abb0f99053f498843 Subject: Re: [PHP-DEV] header() removes all header of the same name. From: me@kelunik.com (Niklas Keller) --94eb2c0d7e8abb0f99053f498843 Content-Type: text/plain; charset=UTF-8 2016-10-20 11:57 GMT+02:00 Yasuo Ohgaki : > Hi Niklas, > > On Thu, Oct 20, 2016 at 6:01 PM, Niklas Keller wrote: > > > > same here, it's not acceptable to limit header and restrict `set_cookie`. > > Just think about all those frameworks that would have to specialcase > setting > > headers now and have to use the cookie API then. > > > > If you want to protect the session cookie header, why not simply set it > > right before the first output? That'd make it also non-overrideable, but > > leaves header() intact. But I guess it's harder to implement. > > Although, I prefer to have completely separate API, we have to > implement vote result. So vote no for "Disabling 'Set-Cookie' for > header*()" vote option. > I don't have a vote. But this breaks BC. It might remove surprisings when using sessions, but having header() not being able to set `set-cookie` headers adds new surprisings. > Regarding about delaying session cookie header, it is possible to use > output buffer to delay output so that session module can send HTTP > header at request shutdown. However, it will break almost all session > enabled applications that require immediate output. Therefore, it's > easy to implement, but not possible for this reason. I meant squeeze in right before output or on first flush() call. There must be a thing that sets a "already output" flag that prevents further headers. We could use that mechanism to buffer all headers and just send them out there and have a hook for the session module. Regards, Niklas > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --94eb2c0d7e8abb0f99053f498843--