Great job on AdapterMan so far! I've been experimenting with this and trying to narrow down some unusual behaviour.
Currently the handling of cookies appends any calls of setCookie to the static $cookies array, but this leads to a situation where multiple calls with the same name ends up returning multiple Set-cookie headers which differs from normal PHP execution.
E.g.
setCookie('myCookie', 1);
setCookie('myCookie', 2);
Normal PHP response
Set-Cookie: myCookie=2; path=/; HttpOnly; SameSite=Strict
AdapterMan
Set-Cookie: myCookie=1; path=/; HttpOnly; SameSite=Strict
Set-Cookie: myCookie=2; path=/; HttpOnly; SameSite=Strict
Relevant code:
|
static::$cookies[] = 'Set-Cookie: ' . $name . '=' . \rawurlencode($value) |
|
static::$cookies[] = $content; |
Great job on AdapterMan so far! I've been experimenting with this and trying to narrow down some unusual behaviour.
Currently the handling of cookies appends any calls of
setCookieto the static$cookiesarray, but this leads to a situation where multiple calls with the same name ends up returning multipleSet-cookieheaders which differs from normal PHP execution.E.g.
Normal PHP response
Set-Cookie: myCookie=2; path=/; HttpOnly; SameSite=StrictAdapterMan
Relevant code:
AdapterMan/src/Http.php
Line 247 in a7c6159
AdapterMan/src/Http.php
Line 186 in a7c6159