I would like to use domain prefix for language selection, like en.example.com and de.example.com. I've set up language detection to Domain here admin/config/regional/language/configure/url.

In theory everything works fine, except that session data is not shared between subdomains. If I log into the main site example.com and then visit en.example.com I have to log in again. Is this behaviour by design? Can I setup drupal to share session data between subdomains? It's the same site after all - only subdomain is different.

1 Answer 1


You need to set the variable $cookie_domain in your settings.php file to your base (default language) domain.

Just search the settings.php file for that variable, uncomment the line and replace '.example.com' with your default language domain preceded with a dot.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.