Re: [PHP-DEV] setcookie() minor BC break - fixes issue #67736

[email protected] (Sherif Ramadan)
Newsgroups php.internals
Message-ID <CAL+t6cEfbd7KbB=EbhdqgLKG6tBURgj+Ls9Y62tjOHL1Y+r-SA@mail.gmail.com>
Actually, we shouldn't be doing that all. We should simply just overwrite
the header. It wouldn't make much sense to set two headers with the same
cookie name when we can just overwrite it.


On Mon, Sep 8, 2014 at 2:50 AM, Tjerk Meesters <[email protected]>
wrote:

> Hi!
>
>
> On Sat, Sep 6, 2014 at 5:38 AM, Florian Margaine <[email protected]>
> 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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.