library/Garp/Auth.php
public function isLoggedIn() {
        $hasUserData    = isset($this->_store->userData);
        $hasLoginMethod = isset($this->_store->method);
        $hasValidToken  = isset($this->_store->token) && $this->validateToken();
        $isLoggedIn     = $hasUserData && $hasLoginMethod && $hasValidToken;

        // Don't leave invalid cookies laying around.
        // Clear data only when data is present, but it is invalid.
        if ($hasUserData && $hasLoginMethod && !$hasValidToken) {
            $this->_store->userData = null;
            $this->_store->method   = null;
        }
        return $isLoggedIn;
    }
public function isLoggedIn() {
        $hasUserData    = isset($this->_store->userData);
        $hasLoginMethod = isset($this->_store->method);
        $hasValidToken  = isset($this->_store->token) && $this->validateToken();
        $isLoggedIn     = $hasUserData && $hasLoginMethod && $hasValidToken;

        // Don't leave invalid cookies laying around.
        // Clear data only when data is present, but it is invalid.
        if ($hasUserData && $hasLoginMethod && !$hasValidToken) {
            $this->_store->userData = null;
            $this->_store->method   = null;
        }
        return $isLoggedIn;
    }
public function isLoggedIn ( ) { $ hasUserData = isset ( $ this -> _store -> userData ) ; $ hasLoginMethod = isset ( $ this -> _store -> method ) ; $ hasValidToken = isset ( $ this -> _store -> token ) && $ this -> validateToken ( ) ; $ isLoggedIn = $ hasUserData && $ hasLoginMethod && $ hasValidToken ; // Don't leave invalid cookies laying around. // Clear data only when data is present, but it is invalid. if ( $ hasUserData && $ hasLoginMethod && ! $ hasValidToken ) { $ this -> _store -> userData = null ; $ this -> _store -> method = null ; } return $ isLoggedIn ; }
Check if a user is logged in
@return Boolean
Check if a user is logged in