private function loggenIn()
    {
        if (!$this->has()) {
            if (!($this->authService instanceof UserAuthServiceInterface)) {
                // Not logged in
                return false;
            }

            // Now try to find only in cookies, if found prepare a bag
            if ($this->reAuth->isStored() && (!$this->has())) {
                $userBag = $this->reAuth->getUserBag();
            }

            // If session namespace is filled up and at the same time data stored in cookies
            if (($this->has() && $this->reAuth->isStored()) || $this->has()) {
                $data = $this->sessionBag->get(self::AUTH_NAMESPACE);

                $userBag = new UserBag();
                $userBag->setLogin($data['login'])
                        ->setPasswordHash($data['passwordHash']);
            }

            // If $userBag wasn't created so far, that means user isn't logged at all
            if (!isset($userBag)) {
                return false;
            }

            // Now let's invoke our defined match visitor
            $authResult = $this->authService->authenticate($userBag->getLogin(), $userBag->getPasswordHash(), false, false);

            if ($authResult == true) {
                // Remember success, in order not to query on each request
                $this->login($userBag->getLogin(), $userBag->getPasswordHash());
                return true;
            }

            return false;

        } else {
            return true;
        }
    }
private function loggenIn()
    {
        if (!$this->has()) {
            if (!($this->authService instanceof UserAuthServiceInterface)) {
                // Not logged in
                return false;
            }

            // Now try to find only in cookies, if found prepare a bag
            if ($this->reAuth->isStored() && (!$this->has())) {
                $userBag = $this->reAuth->getUserBag();
            }

            // If session namespace is filled up and at the same time data stored in cookies
            if (($this->has() && $this->reAuth->isStored()) || $this->has()) {
                $data = $this->sessionBag->get(self::AUTH_NAMESPACE);

                $userBag = new UserBag();
                $userBag->setLogin($data['login'])
                        ->setPasswordHash($data['passwordHash']);
            }

            // If $userBag wasn't created so far, that means user isn't logged at all
            if (!isset($userBag)) {
                return false;
            }

            // Now let's invoke our defined match visitor
            $authResult = $this->authService->authenticate($userBag->getLogin(), $userBag->getPasswordHash(), false, false);

            if ($authResult == true) {
                // Remember success, in order not to query on each request
                $this->login($userBag->getLogin(), $userBag->getPasswordHash());
                return true;
            }

            return false;

        } else {
            return true;
        }
    }
private function loggenIn ( ) { if ( ! $ this -> has ( ) ) { if ( ! ( $ this -> authService instanceof UserAuthServiceInterface ) ) { // Not logged in return false ; } // Now try to find only in cookies, if found prepare a bag if ( $ this -> reAuth -> isStored ( ) && ( ! $ this -> has ( ) ) ) { $ userBag = $ this -> reAuth -> getUserBag ( ) ; } // If session namespace is filled up and at the same time data stored in cookies if ( ( $ this -> has ( ) && $ this -> reAuth -> isStored ( ) ) || $ this -> has ( ) ) { $ data = $ this -> sessionBag -> get ( self :: AUTH_NAMESPACE ) ; $ userBag = new UserBag ( ) ; $ userBag -> setLogin ( $ data [ 'login' ] ) -> setPasswordHash ( $ data [ 'passwordHash' ] ) ; } // If $userBag wasn't created so far, that means user isn't logged at all if ( ! isset ( $ userBag ) ) { return false ; } // Now let's invoke our defined match visitor $ authResult = $ this -> authService -> authenticate ( $ userBag -> getLogin ( ) , $ userBag -> getPasswordHash ( ) , false , false ) ; if ( $ authResult == true ) { // Remember success, in order not to query on each request $ this -> login ( $ userBag -> getLogin ( ) , $ userBag -> getPasswordHash ( ) ) ; return true ; } return false ; } else { return true ; } }
Checks whether user is logged in

@return boolean
Checks whether user is logged in