8000 GitHub · Where software is built
[go: up one dir, main page]

Skip to content
[HttpFoundation] PhpBridgeSessionStorage - Exceptions thrown when error reporting reports warnings. #8554
Closed
@AtliThor

Description

@AtliThor

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');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0