Symfony 2.1 Session Local Value and Master Value (read on phpinfo)

帅比萌擦擦* 提交于 2019-12-13 17:18:12

问题


I'm having problems with sessions when i sarted migration from symfony 2.0 to symfony 2.1.

I'm using simplesamlphp for authentication and everything was working ok on symfony 2.0.

On Symfony 2.1 it is NOT OK. I checked the diferences between them on phpinfo->session and this what i got:

                          symfony2.1         symfony 2.0        Master Value
session.save_handler         user              files                files

session.save_path     (..)/symproject/app   (..)/wamp/tmp      (..)/wamp/tmp
                      /cache/dev/sessions

This values must be equal to php.ini since simplesaml requires it!

I could set the framework:session:save_path property on config.yml but i think this is not a good practice since save path might be diferent depending if im on my local development machine or not (i have my project on git).

And about save_handler i could not find a waay to specify it on config.yml. Am i stick with "user" on this?

What is happening in this symfony version?? In symfony 2.0 this was out of box! Please help. There is no decent documentation on this (believe me i've looked!!).


回答1:


Finally i've got it!

Symfony 2.1 had the Native* drivers by default. And this overrides configurations existing on php.ini.

If you want to use php-ini configs you must pass null to the NativeSessionStorage constructor for the handler arg.

This is done by putting the following configurations on config.yml:

framework:
    session:
        handler_id: ~

More information on this decision can be read here.

This information is missing from symfony docuymentation and upgrade manual.



来源:https://stackoverflow.com/questions/12618953/symfony-2-1-session-local-value-and-master-value-read-on-phpinfo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!