Skip to content

Commit

Permalink
Site in subdirectory cookie is not set correctly — fixes #1211
Browse files Browse the repository at this point in the history
  • Loading branch information
omega8cc committed Sep 20, 2017
1 parent f2eb6a4 commit ef85b50
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aegir/conf/global.inc
Expand Up @@ -829,9 +829,12 @@ if (!$is_backend && isset($_SERVER['HTTP_HOST']) &&
header("X-Site-Subdir: " . $site_subdir);
}

if ($all_ini['server_name_cookie_domain'] || $site_subdir) {
if ($all_ini['server_name_cookie_domain']) {
$domain = '.' . preg_replace('`^www\.`', '', $_SERVER['SERVER_NAME']);
}
elseif ($site_subdir && isset($_SERVER['RAW_HOST'])) {
$domain = '.' . preg_replace('`^www\.`', '', $_SERVER['RAW_HOST']);
}
else {
$domain = '.' . preg_replace('`^www\.`', '', $_SERVER['HTTP_HOST']);
}
Expand Down

0 comments on commit ef85b50

Please sign in to comment.