Redirect to language specific domain alias keeps from logging in

Created on 19 September 2012, over 12 years ago
Updated 2 May 2025, about 1 month ago

On a multilingual site, I'm using Domain Alias with the following two language-specific subdomains (as specified both in admin/config/regional/language and admin/structure/domain/view/1/alias):
German: de.foo.de
English: en.foo.de
So far, everything fine.

Using Domain Alias, I'm now trying to redirect de.foo.de to plain foo.de.
The result is that in the German locale I'm not able to log in anymore. de.foo.de correctly sends me to foo.de, however at foo.de, Drupal refuses to write a session cookie at all, no matter if I setcookie_domain to .foo.de or leave it commented out.

(Certainly, a session cookie de.foo.de wouldn't be helpful when immediately redirecting to foo.de. However, in combination with $cookie_domain this should work fine allowing me to use de.foo.de as a valid alias of foo.de for every path given. But let's leave that apart to reduce complexity at this point.)

The first approach would be that Domain Alias redirects too early, not allowing Drupal to write a cookie for de.foo.de.

A second approach would make Domain alias redirects take precedence over the Language domain specified in admin/config/regional/language, resulting in Drupal writing a cookie for foo.de instead.

While a workaround (and maybe the more straightforward solution) would be to rightaway specify foo.de instead of de.foo.de as Language domain in admin/config/regional/language, the other setup shouldn't lead to a tricky error.

πŸ’¬ Support request
Status

Closed: outdated

Version

3.0

Component

- Domain Alias

Created by

Pancho UTC+2 πŸ‡ͺπŸ‡Ί EU

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024