Index: trunk/core/kernel/session/session.php =================================================================== diff -u -r937 -r939 --- trunk/core/kernel/session/session.php (.../session.php) (revision 937) +++ trunk/core/kernel/session/session.php (.../session.php) (revision 939) @@ -331,41 +331,53 @@ { if (!empty($this->CachedSID) && $use_cache) return $this->CachedSID; $http_query =& $this->Application->recallObject('HTTPQuery'); + $get_sid=$this->Application->GetVar($this->GETName); switch ($this->Mode) { case smAUTO: - if ($this->CookiesEnabled) { //Cookies has the priority - we ignore everything else - $sid = $http_query->Cookie[$this->CookieName]; - } - else { - $sid = $http_query->Get($this->GETName); - } + //Cookies has the priority - we ignore everything else + $sid=$this->CookiesEnabled?$http_query->Cookie[$this->CookieName]:$get_sid; break; case smCOOKIES_ONLY: - $sid = $http_query->Cookie[$this->CookieName]; + $sid = $http_query->Cookie[$this->CookieName]; break; case smGET_ONLY: - $sid = $http_query->Get($this->GETName); + $sid = $get_sid; break; case smCOOKIES_AND_GET: - $cookie_sid = $http_query->Cookie[$this->CookieName]; - $get_sid = $http_query->Get($this->GETName); - //both sids should match if cookies are enabled - if (!$this->CookiesEnabled || ($cookie_sid == $get_sid)) - $sid = $get_sid; //we use get here just in case cookies are disabled - else - $sid = ''; + $cookie_sid = $http_query->Cookie[$this->CookieName]; + //both sids should match if cookies are enabled + if (!$this->CookiesEnabled || ($cookie_sid == $get_sid)) + { + $sid = $get_sid; //we use get here just in case cookies are disabled + } + else + { + $sid = ''; + } break; } $this->CachedSID = $sid; return $this->CachedSID; } + /** + * Returns session id + * + * @return int + * @access public + */ function GetID() { return $this->SID; } + /** + * Generates new session id + * + * @return int + * @access private + */ function GenerateSID() { list($usec, $sec) = explode(" ",microtime()); @@ -383,6 +395,12 @@ return $this->SID; } + /** + * Set's new session id + * + * @param int $new_sid + * @access private + */ function setSID($new_sid) { $this->SID=$new_sid; @@ -421,6 +439,11 @@ ); } + /** + * Refreshes session expiration time + * + * @access private + */ function Refresh() { if ($this->CookiesEnabled) $this->SetSessionCookie(); //we need to refresh the cookie