8000 NativeSessionStorage hides useful error information from handlers · Issue #28467 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
NativeSessionStorage hides useful error information from handlers #28467
Closed
@VasekPurchart

Description

@VasekPurchart

Symfony version(s) affected: 3.x, 4.x

Description

NativeSessionStorage uses a mechanism to suppress errors/warnings from handers and states that:

https://github.com/symfony/symfony/blob/v4.1.4/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php#L243-L252

The default PHP error message is not very helpful, as it does not give any information on the current save handler. Therefore, we catch this error and trigger a warning with a better error message

While it is true, that the handler is not mentioned, throwing away the error/warning is not desirable, because it may contain really useful information for debugging, which cannot be obtained anywhere else if it is silenced.

Possible Solution

I think either the messages should be combined - the message from the handler should be appended to the current one for example.

Or we might inject a logger (if available as other components do it) and log the message instead of throwing it away.

I will be happy to provide a PR, if a solution is agreed upon here.

Additional context
In our case it was hiding this message which I believe you cannot see anywhere else otherwise and was crucial to solve a problem which occured after upgrading to Symfony 3.4:

Memcached::touch(): using touch command with binary protocol is not recommended with libmemcached versions below 1.0.18, please use ascii protocol or upgrade libmemcached

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0