Description
When configuring Symfony 2.3 to use PhpBridgeSessionStorage
as proposed in the second snippet in this doc article:
http://symfony.com/doc/2.3/cookbook/session/php_bridge.html
If the session is started in, or before, the standard app_dev.php script - or even the app.php script, if PHP is configured to display warnings - the two ini_set
calls in the NativeFileSessionHandler
constructor will trigger PHP warnings, as the session_path and session_handler directives can't be set after the session is started. Symfony converts them into exceptions, halting the execution of the page.
It would make more sense to check the session status in the constructor before issuing the ini_set calls, rather than relying on a lack of error reporting for this feature to be used in this manner. They would have no effect if the session is started either way.
if (PHP_SESSION_ACTIVE !== session_status()) {
ini_set('session.save_path', $savePath);
ini_set('session.save_handler', 'files');
}