Index: branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php =================================================================== diff -u -r7781 -r7828 --- branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php (.../application.php) (revision 7781) +++ branches/unlabeled/unlabeled-1.170.2/core/kernel/application.php (.../application.php) (revision 7828) @@ -1584,11 +1584,13 @@ } ob_end_flush(); + // session expiration is called from session initialization, // that's why $this->Session may be not defined here - if (is_object($this->Session)) { - $this->Session->SaveData(); - } + $session =& $this->Application->recallObject('Session'); + /* @var $session Session */ + + $session->SaveData(); exit; } @@ -2231,16 +2233,14 @@ return $event; } - + /** + * Allows to check if user in this session is logged in or not + * + * @return bool + */ function LoggedIn() { - $user_id = $this->Application->RecallVar('user_id'); - - $ret = $user_id > 0; - if ($this->IsAdmin() && ($user_id == -1)) { - $ret = true; - } - return $ret; + return $this->Session->LoggedIn(); } /**