Symfony 3 sharing cookies across sub-domains?

别来无恙 提交于 2019-12-10 13:29:24

问题


I want to share a cookie across any subdomain. This should then allow me to keep the session. I am using the Symfony framework version 3.0.

I've read that you should set the following:

## app/config/config.yml
   session:
       cookie_domain: .localhost

I tried multiple variations on this but none of them change anything. the domain associated with the cookie won't change. Any ideas how this should be done?? What am I missing.


回答1:


To be sure you need to delete your cookie and log back.

session:
    cookie_lifetime: 0
    save_path: %kernel.root_dir%/var/sessions
    cookie_domain: .my-domain.com
    name: SFSESSID


来源:https://stackoverflow.com/questions/47098276/symfony-3-sharing-cookies-across-sub-domains

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