Candidate fix for cookie/tld bug.
NOTE: This change has not been thoroughly tested. Please ensure that you make backups of any files that you change.
Changes required to
admin/includes/functions/general.php
includes/functions/functions_general.php
In both files the function zen_get_top_level_domain should be replaced with the following
PHP Code:
function zen_get_top_level_domain($url) {
if (strpos($url, '://')) {
$url = parse_url($url);
$url = $url['host'];
}
$domain_array = explode('.', $url);
$domain_size = sizeof($domain_array);
if ($domain_size > 1) {
if (SESSION_USE_FQDN == 'True') return $url;
if (is_numeric($domain_array[$domain_size-2]) && is_numeric($domain_array[$domain_size-1])) {
return false;
} else {
$tld = "";
foreach ($domain_array as $dPart)
{
if ($dPart != "www") $tld = $tld . "." . $dPart;
}
return substr($tld, 1);
}
} else {
return false;
}
}
Changes to
admin/includes/init_includes/init_sessions.php
includes/init_includes/init_sessions.php
in both files replace the line that reads
Code:
session_set_cookie_params(0, '/', (zen_not_null($current_domain) ? $current_domain : ''));
with
Code:
session_set_cookie_params(0, '/', (zen_not_null($current_domain) ? "." . $current_domain : ''));
Bookmarks