Index: branches/unlabeled/unlabeled-1.52.4/core/kernel/session/session.php =================================================================== diff -u -r6864 -r7092 --- branches/unlabeled/unlabeled-1.52.4/core/kernel/session/session.php (.../session.php) (revision 6864) +++ branches/unlabeled/unlabeled-1.52.4/core/kernel/session/session.php (.../session.php) (revision 7092) @@ -488,21 +488,26 @@ else { //Otherwise we still suppose cookies are on, because may be it's the first time user visits the site //So we send cookies on to get it next time (when referal will tell us if they are realy off - setcookie( - 'cookies_on', - 1, - adodb_mktime()+31104000, //one year should be enough - $this->CookiePath, - $this->CookieDomain, - $this->CookieSecure - ); + $this->SetCookie('cookies_on', 1, adodb_mktime() + 31104000); //one year should be enough } } else $this->CookiesEnabled = true; return $this->CookiesEnabled; } + /** + * Sets cookie for current site using path and domain + * + * @param string $name + * @param mixed $value + * @param int $expires + */ + function SetCookie($name, $value, $expires = null) + { + setcookie($name, $value, $expires, $this->CookiePath, $this->CookieDomain, $this->CookieSecure); + } + function Check() { // we should check referer if cookies are disabled, and in combined mode @@ -663,15 +668,7 @@ */ function SetSessionCookie() { - setcookie( - $this->CookieName, - $this->SID, - $this->Expiration, - $this->CookiePath, - $this->CookieDomain, - $this->CookieSecure - ); - + $this->SetCookie($this->CookieName, $this->SID, $this->Expiration); $_COOKIE[$this->CookieName] = $this->SID; // for compatibility with in-portal }