我有两个子域:
www.example.com和static.example.com
根域example.com重定向到www.example.com。
如何在Symfony2 / 3中将Cookie限制在www.example.com,并使static.example.com不含cookie。我在config.yml中找不到任何cookie部分。
使用这些功能时如何指定特定的子域:
href =" {{asset(' favicon.png')}}"
href =" {{path(' blog_show')}}"
$ this-> generateUrl(' blog_show',array(' slug' =>' my-blog-post'));
PS:我也对Apache有完全控制权。
答案 0 :(得分:1)
framework:
templating:
assets_base_urls:
http: static.example.com
http://symfony.com/doc/master/reference/configuration/framework.html#assets-base-urls
您可以将资产分组到包中,为它们指定不同的基本URL:
framework:
templating:
packages:
avatars:
base_urls: 'static.example.com'
http://symfony.com/doc/master/reference/configuration/framework.html#packages
对于其他问题:网址生成,我不确定什么意思是无Cookie路径。