8000 minor #41448 [HttpFoundation] Remove dead code for emulating SameSite… · symfony/symfony@17800d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 17800d1

Browse files
minor #41448 [HttpFoundation] Remove dead code for emulating SameSite cookie (mbabker)
This PR was merged into the 6.0 branch. Discussion ---------- [HttpFoundation] Remove dead code for emulating SameSite cookie | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A Follow up to #41295, the code setting the `$emulateSameSite` property was based on a PHP version conditional that's no longer used. Commits ------- a0a935a Remove dead code for emulating SameSite cookie
2 parents d1be34d + a0a935a commit 17800d1

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\HttpFoundation\Session\Storage;
1313

1414
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
15-
use Symfony\Component\HttpFoundation\Session\SessionUtils;
1615
use Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler;
1716
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
1817
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
@@ -54,11 +53,6 @@ class NativeSessionStorage implements SessionStorageInterface
5453
*/
5554
protected $metadataBag;
5655

57-
/**
58-
* @var string|null
59-
*/
60-
private $emulateSameSite;
61-
6256
/**
6357
* Depending on how you want the storage driver to behave you probably
6458
* want to override this constructor entirely.
@@ -157,13 +151,6 @@ public function start()
157151
throw new \RuntimeException('Failed to start the session.');
158152
}
159153

160-
if (null !== $this->emulateSameSite) {
161-
$originalCookie = SessionUtils::popSessionCookie(session_name(), session_id());
162-
if (null !== $originalCookie) {
163-
header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite), false);
164-
}
165-
}
166-
167154
$this->loadSession();
168155

169156
return true;
@@ -225,16 +212,7 @@ public function regenerate(bool $destroy = false, int $lifetime = null)
225212
$this->metadataBag->stampNew();
226213
}
227214

228-
$isRegenerated = session_regenerate_id($destroy);
229-
230-
if (null !== $this->emulateSameSite) {
231-
$originalCookie = SessionUtils::popSessionCookie(session_name(), session_id());
232-
if (null !== $originalCookie) {
233-
header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite), false);
234-
}
235-
}
236-
237-
return $isRegenerated;
215+
return session_regenerate_id($destroy);
238216
}
239217

240218
/**

0 commit comments

Comments
 (0)
0