I have a rails application that supports multiple domains, and each domain can have multiple subdomains.
Users who visit mydomain1.com do not get the same experience as mydomain2.com (although the basic behavior of the applications is the same)
Therefore, if a user is logged in to mydomain1.com, he should not be registered at mydomain2.com
If a user is logged in to france.mydomain1.com, he must then log in to germany.mydomain1.com
Earlier, I dealt with this by setting the domain in the session storage configurations:
MyApp::Application.config.session_store :cookie_store, :key => '_MyApp_session', :domain => APP_CONFIG[:domain]
Am I trying to find a better way to handle these multiple domains?
I tried to crack ActionDispatch::Callback , but the request is not available there.
Can anyone suggest a good way to support multiple cookies from one application?
Ideally, I would like to create a fresh cookie for each subdomain .
source share