Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[HttpFoundation][Sessions] NativeFileSession won't override the php.ini settings anymore #5267
This is a redo of #5266 as I had to delete my repository for some other reasons.
Bug fix: yes - but in the 2.1 branch
Today I've noticed that the sessions are stored in files even if the configuration of the PHP server was to use the memcached driver to do so.
referenced this pull request
Aug 15, 2012
No, it is as the name says - native file session handler :-)
As I said before if you want to leave the save handlers as specified in php.ini (which is a mistake imo), then simply pass
As a matter of principal, an application's configuration be explicit and not make assumptions about the environment it's deployed in. You might have an exception for this, but as a general rule, the application should behave the same way on server 1 or server 2 because it makes the application robust and saves some poor admin time scratching their head as to why server 1 works, and server 2's deployment doesn't.
This is why we had the
This is already configurable, the default folder is sensible for most purposes. Especially when testing or re-deploying clearing out sessions may make very good sense.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
@Drak Thanks for feedback.
I've got the first part but either I'm too asleep right now, or passing: handler_id: null doesn't help at all. All I get is a big error. You can check it out at: https://github.com/dlsniper/symfony-standard maybe you can spot something that I don't understand/I'm doing wrong.
In regards to the whole
As for changing the folder path, I think I've seen at least half a dozen of people complaining about the problem that they've deleted the cache folder and they've lost the sessions in process. Maybe a manual warning might be enough but lets face it, if they didn't knew where the sessions are stored what makes you think that they'll notice that? Even so,
@dlsniper - you are missing the point. Doing so would just be a hack. The right way to do this is to allow the configuration in FrameworkBundle to accept null like this:
For those not using just the component, they pass null in the constructor (which means just not completing the second arg).