Skip to content

Commit

Permalink
Fix erasing cookies issue
Browse files Browse the repository at this point in the history
Prevent replacing existing cookies when starting or regenerating session on PHP < 7.3 with 'cookie_samesite' option.
See issue #29675
  • Loading branch information
eiannone authored and fabpot committed Jan 1, 2019
1 parent 113ba10 commit b40801a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function start()
if (null !== $this->emulateSameSite) {
$originalCookie = SessionUtils::popSessionCookie(session_name(), session_id());
if (null !== $originalCookie) {
header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite));
header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite), false);
}
}

Expand Down Expand Up @@ -225,7 +225,7 @@ public function regenerate($destroy = false, $lifetime = null)
if (null !== $this->emulateSameSite) {
$originalCookie = SessionUtils::popSessionCookie(session_name(), session_id());
if (null !== $originalCookie) {
header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite));
header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite), false);
}
}

Expand Down

0 comments on commit b40801a

Please sign in to comment.