Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Inform the user when save_path will be ignored#31620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
gnat42 commentedMay 25, 2019
I haven't added tests yet because I'm not 100% sure what the best way to solve this was. This at least informs the user. However if it were possible to detect this and somehow have ini_set('session.save_path', $save_path); called that would fix the 'bug' but where to put that is a bit of a mystery. I also expect it may be useful to update the documentation related to this setting to explain why which I'd be happy to do if this was deemed the correct solution. |
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
01f5e22 to267a4f7Compare| publicfunctiontestNullSessionHandlerWithSavePath() | ||
| { | ||
| $this->expectException(InvalidConfigurationException::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Must be converted to an annotation for tests to pass on old PHP versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
267a4f7 toa090129Comparefabpot commentedJul 8, 2019
Thank you@gnat42. |
…gnored (gnat42)This PR was squashed before being merged into the 3.4 branch (closes#31620).Discussion----------[FrameworkBundle] Inform the user when save_path will be ignored| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no / maybe??| Deprecations? | no| Tests pass? | yes| Fixed tickets |#31611| License | MITWhen a project is created, framework.yaml or config.yml has handler_id set to ~. This uses the native php SessionHandler object which is instantiated with the save_path setting from php.ini or php-fpm.d/www.conf. If you set a save_path, it is silently ignored. When using mod_php for apache or php-fpm running as apache/nginx this is typically not a big deal (except your session files are stored someplace other than you actually wanted). However if using php-fpm and running as a non-standard user for the distro, it will fail silently. Sessions won't be saved because the setting has no effect. This throws a warning in those cases to inform the user._It could be a BC because it changes the default configuration however fixes a 'long standing bug' if you will. Not sure what you want to do about that part._Commits-------a090129 [FrameworkBundle] Inform the user when save_path will be ignored
gnat42 commentedJul 10, 2019
thank you!@fabpot |
* 3.4: Revert "bug#31620 [FrameworkBundle] Inform the user when save_path will be ignored (gnat42)" [Form][PropertyPathMapper] Avoid extra call to get config
* 4.3: Revert "bug#31620 [FrameworkBundle] Inform the user when save_path will be ignored (gnat42)" [Form][PropertyPathMapper] Avoid extra call to get config [HttpKernel] remove unused fixtures
* 4.4: Revert "bug#31620 [FrameworkBundle] Inform the user when save_path will be ignored (gnat42)" [Form][PropertyPathMapper] Avoid extra call to get config [HttpKernel] remove unused fixtures
Uh oh!
There was an error while loading.Please reload this page.
When a project is created, framework.yaml or config.yml has handler_id set to ~. This uses the native php SessionHandler object which is instantiated with the save_path setting from php.ini or php-fpm.d/www.conf. If you set a save_path, it is silently ignored. When using mod_php for apache or php-fpm running as apache/nginx this is typically not a big deal (except your session files are stored someplace other than you actually wanted). However if using php-fpm and running as a non-standard user for the distro, it will fail silently. Sessions won't be saved because the setting has no effect. This throws a warning in those cases to inform the user.
It could be a BC because it changes the default configuration however fixes a 'long standing bug' if you will. Not sure what you want to do about that part.