Skip to content

CookieSerializer

Bridges cookies queued on a Quiote response onto a PSR-7 response’s Set-Cookie headers.

The response is duck-typed rather than declared, so a middleware can hand over whatever the controller gave it without first proving it is a WebResponse. The serialization itself belongs to CookieSerializer, which is the one implementation of the Set-Cookie format in the framework; this class only locates the cookies and merges the resulting lines.

final class CookieSerializer

SourceHttp/CookieSerializer.php
MethodDescription
bridge(object $globalResp, ResponseInterface $response, string $basePath = '/'): ResponseInterfaceAppend Set-Cookie headers from $globalResp to $response.

public static function bridge(object $globalResp, ResponseInterface $response, string $basePath = '/'): ResponseInterface

Append Set-Cookie headers from $globalResp to $response.

Default path for cookies without explicit path.

ParameterTypeDescription
$globalRespobjectQuiote web response object (duck-typed).
$responseResponseInterfacePSR-7 response to append headers to.
$basePathstringDefault path for cookies without explicit path.

Returns ResponseInterface — The (immutably) updated response.