Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8bc22e

Browse files
committed
Do not throw when setSaveHandler is called and headers have already been sent
1 parent 99f8d85 commit c8bc22e

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,6 @@ public function setSaveHandler($saveHandler = null)
395395
throw new \InvalidArgumentException('Must be instance of AbstractProxy or NativeSessionHandler; implement \SessionHandlerInterface; or be null.');
396396
}
397397

398-
if (headers_sent($file, $line)) {
399-
throw new \RuntimeException(sprintf('Failed to set the session handler because headers have already been sent by "%s" at line %d.', $file, $line));
400-
}
401-
402398
// Wrap $saveHandler in proxy and prevent double wrapping of proxy
403399
if (!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \SessionHandlerInterface) {
404400
$saveHandler = new SessionHandlerProxy($saveHandler);

0 commit comments

Comments
 (0)