Skip to content

Commit

Permalink
Merge pull request #17 from bakurin/fix-set-cookie-header-overriding
Browse files Browse the repository at this point in the history
Prevent overriding `Set-Cookie` header
  • Loading branch information
tboronczyk authored Mar 25, 2020
2 parents 5db0c16 + 00478a1 commit e903e52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/LocalizationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function __invoke(Request $req, Response $resp, callable $next)
$req = $req->withAttribute($this->reqAttrName, $locale);

if (in_array(self::FROM_COOKIE, $this->searchOrder)) {
$resp = $resp->withHeader(
$resp = $resp->withAddedHeader(
'Set-Cookie',
"{$this->cookieName}=$locale; Path={$this->cookiePath}; Expires={$this->cookieExpire}"
);
Expand Down

0 comments on commit e903e52

Please sign in to comment.