Skip to content

Cookie-Names are prefixed with "Set-Cookie:" by AbstractSessionHandler::destroy #25393

@pableu

Description

@pableu

When creating cookies using setcookie() whilst having a session started, our own cookies are prefixed by "Set-Cookie".

I think the issue becomes quite obvious by reading AbstractSessionHandler::destroy:

In line 143, all headers that don't start with "Set-Cookie:" are skipped. Then in Lines 150 and 153, they are added to $otherCookies.

In line 159, they are prefixed again with "Set-Cookie:" and passed to header(). This results in headers such as Set-Cookie: Set-Cookie: test=foo; path=/.

I think the correct solution would be to change line 159 to header($h, false);.

Symfony Version: 3.4.1
PHP-Version: 7.0.22
OS: Ubuntu 16.04

Some Screenshots from the Chrome Devtools:
Headers:
headers
Cookies: cookies

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions