Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77111 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27317 invoked from network); 9 Sep 2014 14:10:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2014 14:10:33 -0000 Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 74.125.82.46 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 74.125.82.46 mail-wg0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:32873] helo=mail-wg0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/91-08634-65A0F045 for ; Tue, 09 Sep 2014 10:10:31 -0400 Received: by mail-wg0-f46.google.com with SMTP id n12so5325904wgh.29 for ; Tue, 09 Sep 2014 07:10:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=NFNY8E2ZHL1C9XNTpEQgvWjG0G9967VRmEAySbW8fjk=; b=BdCUbHXs3vhiEGNF838NHej/8j23LMON5CpFbhdl3vCeEdyulo6nIvks8qXozw6x/a N1crklxG987hyX8t9QmrPZiBYWioIN3S6y5J50VYQ/9ir/XDpKi7IOagM8G1y8qHaQa1 WM7voZAC1DCOXtsQ6zjNwTX/SvaukDLZnfFn8Bp13+Oz0sM7jqusuY7y+++NpzWq+8g5 QD6raQqZzyvdbechSKPu/yJ2np3Vn3IOauwlkNIF0YG6xwwtUqLtXRZyWxyI5GJLmbdr cN+/QRt8rQZl5H1k55mPTLgmcISN09gHny23Jln5MzMtL1GFNaOKITfDBPUWtmzCoxoV TpjA== X-Gm-Message-State: ALoCoQk+mfgBzvNcTaVPPoFoBamya7+Jl9tswCBwA3pA6cB5f3e9GompgmU64H6bfMviGs+7Clj0 MIME-Version: 1.0 X-Received: by 10.194.122.169 with SMTP id lt9mr43314214wjb.29.1410271827388; Tue, 09 Sep 2014 07:10:27 -0700 (PDT) Received: by 10.217.10.137 with HTTP; Tue, 9 Sep 2014 07:10:27 -0700 (PDT) X-Originating-IP: [2.99.225.46] In-Reply-To: References: Date: Tue, 9 Sep 2014 15:10:27 +0100 Message-ID: To: Tjerk Meesters Cc: Florian Margaine , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] setcookie() minor BC break - fixes issue #67736 From: danack@basereality.com (Dan Ackroyd) > How about delaying that warning until the headers are sent? I don't think there would be any benefit to that. The only possible scenarios are: i) People sending duplicate headers by accident. When they see the error, they should fix their code, so the error goes away. ii) People who are deliberately sending duplicate headers (e.g. for a custom client that requires them). They will be suppressing the error and so it won't be seen anywhere. As I said in the PR, the current behaviour isn't a PHP bug, it's doing exactly what it was told to do by callee. Changing the behaviour of setcookie to 'guess' what the programmer really meant would definitely be wrong, and I'm not sure that giving a warning is all that helpful either. cheers Dan On 8 September 2014 07:50, Tjerk Meesters wrote: > Hi! > > > On Sat, Sep 6, 2014 at 5:38 AM, Florian Margaine > wrote: > >> Hi, >> >> This is a minor BC break, but still a BC break, so worth discussing on this >> ML. >> >> When a second setcookie() is done with the same name, a warning is emitted, >> because the ietf rfc 6265 says it *should* only send one Set-Cookie header >> per name. >> >> This is fine when display_errors is set to off. When it's set to on, the >> warning prevents the header from being added because "headers already sent" >> (which is the minor BC break, as current PHP just sends 2 Set-Cookie >> headers with the same name). >> > > Yeah, it would prevent any header() or setcookie() following that warning > from taking place. > > How about delaying that warning until the headers are sent? > > >> >> So, should it be merged? What should be done to comply with the ietf rfc >> 6265? >> >> PR: https://github.com/php/php-src/pull/795/ >> PHP issue: https://bugs.php.net/bug.php?id=67736 >> >> Regards, >> >> *Florian Margaine* >> > > > > -- > -- > Tjerk