Description
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.