symfony/symfony — pull request #7634 by MidnightLightning (2013-04-11 21:11:55+00:00)
Title: PDO Session handling enhancements

Some enhancements I worked out trying to get PDO session storage to work on a rather locked-down webhost:

Don't rely on requiring `ini_set()` as part of the initial construction of a `NativeSessionStorage` object. On the shared hosting provider I was testing with, `ini_set()` was disabled, but there was the ability to create your own, custom user `php.ini` file. So, here the Native Session Storage object first checks with `ini_get()` if the value is already what is needed, before attempting to set it with `ini_set()`.

Additionally, through trying to troubleshoot why my session data wasn't saving, I realized that I had misconfigured my database table configuration, and the PDO queries were sending errors. But the `PdoSessionHandler` class assumes that the PDO object is set to throw exceptions, not errors. I added a line in the constructor to set that attribute, so configuration/query errors are able to be seen and caught a lot easier.