Category Archives: appdomain

Symfony 2 login on two domains

We are running a Symfony 2.1 App, that has let's say the domain www.foo.com there the login isn't a problem at all. But we have a second site www.bar.com which is basically just www.foo.com/bar with an proxy rewrite

RewriteCond %{HTTP_HOST} ^(www\.)?bar\.com$ [NC]
RewriteRule ^(.*) http://www.foo.com/bar$1 [L,P,NE]

This works like a charm too, except for the login. I always get redirected to www.foo.com/login and then of course the login cookie is only set for domain www.foo.com. Is there a way to tell Symfony about the second domain?