I want to use the Middleware to add a cookie.
In TYPO3 I have the Psr\Http\Message\ServerRequestInterface $request
and the Psr\Http\Server\RequestHandlerInterface $handler
variables.
What is the best practise to add a cookie with all the needed settings (secure, domain, expire)?
There is no explicit interface in PSR for this since it basically boils down to sending a
Set-Cookie
header in the$response
. You can either build that header yourself or use some packages which do this for you: