Symfony2 + FOSUserBundle + few subdomains

504 views Asked by At

I have one site with few subdomains. domain.com, d1.domain.com, d2.domain.com, etc.

I've implemented authentication with FOSUserBundle and when I log in being on d1.domain.com and I go to d2.domain.com I'm not logged in. Any ideas how can I login to all subdomains?

1

There are 1 answers

0
nacmartin On

You have to attach the cookie to a domain.

According to http://symfony.com/doc/current/reference/configuration/framework.html#cookie-domain

You should use something like

parameters:
    domain: domain.com

framework:
    session:
        cookie_domain: ".%domain%"