Description
When using this HttpKernel adapter with the Laravel bootstrap I am seeing duplicate Set-Cookie
headers being sent.
Is this supposed to happen? It doesn't seem to break anything in my testing so far though.
From what I can see, this is occurring because of line 276 of PHPPM\Bridges\HttpKernel
in which an array of cookies is being merged with existing Set-Cookie
headers on the SymfonyResponse object:
$headers['Set-Cookie'] = array_merge((array)$headers['Set-Cookie'], $cookies);
Does this need to happen? You're already merging $nativeHeaders
with all of the SymfonyResponse object headers on line 247:
$headers = array_merge($nativeHeaders, $syResponse->headers->allPreserveCase());
I've created a demo project to show the issue: https://github.com/adrianfalleiro/laravel-5.6-ppm-example
All you need to do is composer install
and then ./vendor/bin/ppm start
. If you inspect the headers on the home page you should be able to see duplicate Set-Cookie headers sent.
Also for context I am running this on macOS 10.12.6 with PHP 7.2.4 installed (via Homebrew).