Description
We have a 'white label' system in place where our system responds to multiple domains. For example:
customer-1.com
customer-2.com
We use a kernel event listener to catch the current domain and show specific assets and content which allows each client to customize the platform.
Then, we have an affiliate program that allows partners to refer users using a vanity URL. For example:
partner-1.customer-1.com
partner-2.customer-2.com
The issue we have run into is that, in order to use wildcards in our cookie domain, we must set cookie_domain in config.yml which means we are limited to using a single domain.
Is there a different way to handle this?
A workaround would be to redirect the user twice but I would like to avoid that. The first redirect would take them from partner-1.customer-1.com to the main customer-1.com and then the cookie would be set without specifically setting cookie_domain. Once that is done, the user could be redirected to the requested route/URI. The result is that the default behavior of using the current domain as the cookie_domain would then take over.