Skip to content

Commit e903e52

Browse files
authored
Merge pull request #17 from bakurin/fix-set-cookie-header-overriding
Prevent overriding `Set-Cookie` header
2 parents 5db0c16 + 00478a1 commit e903e52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/LocalizationMiddleware.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function __invoke(Request $req, Response $resp, callable $next)
157157
$req = $req->withAttribute($this->reqAttrName, $locale);
158158

159159
if (in_array(self::FROM_COOKIE, $this->searchOrder)) {
160-
$resp = $resp->withHeader(
160+
$resp = $resp->withAddedHeader(
161161
'Set-Cookie',
162162
"{$this->cookieName}=$locale; Path={$this->cookiePath}; Expires={$this->cookieExpire}"
163163
);

0 commit comments

Comments
 (0)