I'm looking for a working solution, to set a secure clone of the session cookie for another domain in a different Symfony2 environment. My idea is, to set a cloned cookie just after a user logged in, so that the user can be authenticated in two different Symfony2 environments on two different domains.
Domain: mysite-a.com // Environment -e site
Domain: api.mysite-b.com // Environment -e api
Where to find something like a controller or event (best solution) to hook in?
I'm using the latest 2.x.dev
version of FOSUserBundle
.
I know, this configuration is pretty ugly. Unfortunately, I'm not allowed to
change the Domain-Configuration from api.mysite-b.com
to api.mysite-a.com
(aka. wildcard-cookies).
I think there is no proper bundle to handle this problem, but in PHP specification you can find an accurate option to manage your problem
$domain
In symfony2 you ened to use Cookie object:
Cookie constructor has the same options as PHP method:
regards,