public function check()
    {
        if ($this->_session->has('auth')) {
            // They have an auth, let's attempt to check expiration
            // and master session
            $s = [
                'session' => $this->_session->get('SCARA_SESSION'),
                'token'   => $this->_session->get('SCARA_SESSION_TOKEN'),
            ];

            $ua = $this->_ssl->untokenize($s['token'], $s['session']);

            if ($ua === hash('sha256', $_SERVER['HTTP_USER_AGENT'])) {
                $expire = $this->_session->get('expire');
                if (time() < $expire) {
                    return true;
                } else {
                    $this->logout();
                }
            }
        }

        return false;
    }
public function check()
    {
        if ($this->_session->has('auth')) {
            // They have an auth, let's attempt to check expiration
            // and master session
            $s = [
                'session' => $this->_session->get('SCARA_SESSION'),
                'token'   => $this->_session->get('SCARA_SESSION_TOKEN'),
            ];

            $ua = $this->_ssl->untokenize($s['token'], $s['session']);

            if ($ua === hash('sha256', $_SERVER['HTTP_USER_AGENT'])) {
                $expire = $this->_session->get('expire');
                if (time() < $expire) {
                    return true;
                } else {
                    $this->logout();
                }
            }
        }

        return false;
    }
public function check ( ) { if ( $ this -> _session -> has ( 'auth' ) ) { // They have an auth, let's attempt to check expiration // and master session $ s = [ 'session' => $ this -> _session -> get ( 'SCARA_SESSION' ) , 'token' => $ this -> _session -> get ( 'SCARA_SESSION_TOKEN' ) , ] ; $ ua = $ this -> _ssl -> untokenize ( $ s [ 'token' ] , $ s [ 'session' ] ) ; if ( $ ua === hash ( 'sha256' , $ _SERVER [ 'HTTP_USER_AGENT' ] ) ) { $ expire = $ this -> _session -> get ( 'expire' ) ; if ( time ( ) < $ expire ) { return true ; } else { $ this -> logout ( ) ; } } } return false ; }
Checks if a user is authenticated.

@return bool
Checks if a user is authenticated .