8000 Remove dead code for emulating SameSite cookie · symfony/symfony@e0684a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit e0684a2

Browse files
committed
Remove dead code for emulating SameSite cookie
1 parent dccdf0f commit e0684a2

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ class NativeSessionStorage implements SessionStorageInterface
5454
*/
5555
protected $metadataBag;
5656

57-
/**
58-
* @var string|null
59-
*/
60-
private $emulateSameSite;
61-
6257
/**
6358
* Depending on how you want the storage driver to behave you probably
6459
* want to override this constructor entirely.
@@ -157,13 +152,6 @@ public function start()
157152
throw new \RuntimeException('Failed to start the session.');
158153
}
159154

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-
167155
$this->loadSession();
168156

169157
return true;
@@ -225,16 +213,7 @@ public function regenerate(bool $destroy = false, int $lifetime = null)
225213
$this->metadataBag->stampNew();
226214
}
227215

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;
216+
return session_regenerate_id($destroy);
238217
}
239218

240219
/**

0 commit comments

Comments
 (0)
0