Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DX] [Session] Improve error message when session write fails #20807

Copy link
Copy link
Closed
@digilist

Description

@digilist
Issue body actions

I got the following error message with Symfony, because a session write failed:

session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/lib/php/sessions)

It took me some to figure out the cause for this. It has nothing to do with the save_path, but this was the first thing I looked into, when trying to solve the issue. However, the actual reason for this error was a wrongly configured memcached host. So the connection to memcached failed and I didn't remember that I had configured memcached sessions at that moment.

I propose to catch the error message and extend it with some useful information (here).

It looks like there is currently no way to get the name of the current save handler, as it is wrapped into a proxy. So we would have to introduce a way to get the current class name (or anything else) to name the current save handler.

If you think this is useful, I'd like to submit a PR.

There is also issue #17845 where many other users had this error and did not find a solution. I don't know, if there was any case in which it had a similar cause, but I think a better error message might help in similar situation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)HttpFoundation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.