src/Authenticator.php
private function validateToken($token)
    {
        // Without a session file, no token will validate.
        if (!file_exists($this->config->getSessionFileName()))
        {
            return false;
        }

        $encrypted = file_get_contents($this->config->getSessionFileName()); // Read encrypted session file.

        $plain = Encryption::decrypt($encrypted, $this->config->getSecretKey()); // Decrypt data.
        $file = Spyc::YAMLLoadString($plain); // Parse YAML.

        return $token == $file['token'] && time() < $file['expires']; // Token must be valid and not expired.
    }
private function validateToken($token)
    {
        // Without a session file, no token will validate.
        if (!file_exists($this->config->getSessionFileName()))
        {
            return false;
        }

        $encrypted = file_get_contents($this->config->getSessionFileName()); // Read encrypted session file.

        $plain = Encryption::decrypt($encrypted, $this->config->getSecretKey()); // Decrypt data.
        $file = Spyc::YAMLLoadString($plain); // Parse YAML.

        return $token == $file['token'] && time() < $file['expires']; // Token must be valid and not expired.
    }
private function validateToken ( $ token ) { // Without a session file, no token will validate. if ( ! file_exists ( $ this -> config -> getSessionFileName ( ) ) ) { return false ; } $ encrypted = file_get_contents ( $ this -> config -> getSessionFileName ( ) ) ; // Read encrypted session file. $ plain = Encryption :: decrypt ( $ encrypted , $ this -> config -> getSecretKey ( ) ) ; // Decrypt data. $ file = Spyc :: YAMLLoadString ( $ plain ) ; // Parse YAML. return $ token == $ file [ 'token' ] && time ( ) < $ file [ 'expires' ] ; // Token must be valid and not expired. }
Returns true if the given authentication token is valid, otherwise returns false.

@param string $token the authentication token to validate
@return bool
Returns true if the given authentication token is valid otherwise returns false .