Skip to content

Commit 91cd128

Browse files
committed
Merge pull request #3075 from Senky/ticket/11613
[ticket/11613] Cookies do not work for netbios domain
2 parents 3ee06b2 + fb41d53 commit 91cd128

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ function set_cookie($name, $cookiedata, $cookietime, $httponly = true)
10631063

10641064
$name_data = rawurlencode($config['cookie_name'] . '_' . $name) . '=' . rawurlencode($cookiedata);
10651065
$expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime);
1066-
$domain = (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain'];
1066+
$domain = (!$config['cookie_domain'] || $config['cookie_domain'] == '127.0.0.1' || strpos($config['cookie_domain'], '.') === false) ? '' : '; domain=' . $config['cookie_domain'];
10671067

10681068
header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . ';' . (($httponly) ? ' HttpOnly' : ''), false);
10691069
}

0 commit comments

Comments
 (0)