You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading and testing the Session.php again after the PR is merged. I noticed that it is possible for globalCookiesDomain to be emptied (filled but later deleted) or remain empty (not filled at all) while subdomain cookies is selected, but the session.cookie_domain is already changed to top level domain.
I think it should not be changed unless the globalCookiesDomain field is not empty. The suggested change is as follows:
The original:
if (!empty($modSettings['globalCookies']))
{
if (preg_match('~^\d{1,3}(\.\d{1,3}){3}$~', $parsed_url['host']) == 0 && preg_match('~(?:[^\.]+\.)?([^\.]{2,}\..+)\z~i', $parsed_url['host'], $parts) == 1) {
@ini_set('session.cookie_domain', '.' . $parts[1]);
The change:
if (!empty($modSettings['globalCookies']))
{
if (preg_match('~^\d{1,3}(\.\d{1,3}){3}$~', $parsed_url['host']) == 0 && preg_match('~(?:[^\.]+\.)?([^\.]{2,}\..+)\z~i', $parsed_url['host'], $parts) == 1) {
if (!empty($modSettings['globalCookiesDomain']))
@ini_set('session.cookie_domain', '.' . $parts[1]);
else
@ini_set('session.cookie_domain', '.' . $parts[0]);
}
Or:
if (!empty($modSettings['globalCookies']) && !empty($modSettings['globalCookiesDomain']))
{
if (preg_match('~^\d{1,3}(\.\d{1,3}){3}$~', $parsed_url['host']) == 0 && preg_match('~(?:[^\.]+\.)?([^\.]{2,}\..+)\z~i', $parsed_url['host'], $parts) == 1)
@ini_set('session.cookie_domain', '.' . $parts[1]);
The text was updated successfully, but these errors were encountered:
I was reading and testing the Session.php again after the PR is merged. I noticed that it is possible for globalCookiesDomain to be emptied (filled but later deleted) or remain empty (not filled at all) while subdomain cookies is selected, but the session.cookie_domain is already changed to top level domain.
I think it should not be changed unless the globalCookiesDomain field is not empty. The suggested change is as follows:
The original:
The change:
Or:
The text was updated successfully, but these errors were encountered: