Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
feat(swoole): Process and respond cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
k911 committed Sep 23, 2018
1 parent 97ae8e7 commit 0b7e883
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Bridge/Symfony/HttpFoundation/ResponseProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ public function process(HttpFoundationResponse $httpFoundationResponse, SwooleRe
}
}

foreach ($httpFoundationResponse->headers->getCookies() as $cookie) {
$swooleResponse->cookie(
$cookie->getName(),
$cookie->getValue() ?? '',
$cookie->getExpiresTime(),
$cookie->getPath(),
$cookie->getDomain() ?? '',
$cookie->isSecure(),
$cookie->isHttpOnly()
);
}

$swooleResponse->status($httpFoundationResponse->getStatusCode());

if ($httpFoundationResponse instanceof BinaryFileResponse) {
Expand Down

0 comments on commit 0b7e883

Please sign in to comment.