public static function isValid(string $name, string $token): bool
    {
        $savedToken = Session::get($name, null, self::$namespace);
        if (isset($savedToken['token'])) {
            if (time() >= $savedToken['time'] + $savedToken['lifetime']) {
                $savedToken['token'] = '';
            }
            return $token === $savedToken['token'];
        }
        return false;
    }
public static function isValid(string $name, string $token): bool
    {
        $savedToken = Session::get($name, null, self::$namespace);
        if (isset($savedToken['token'])) {
            if (time() >= $savedToken['time'] + $savedToken['lifetime']) {
                $savedToken['token'] = '';
            }
            return $token === $savedToken['token'];
        }
        return false;
    }
public static function isValid ( string $ name , string $ token ) : bool { $ savedToken = Session :: get ( $ name , null , self :: $ namespace ) ; if ( isset ( $ savedToken [ 'token' ] ) ) { if ( time ( ) >= $ savedToken [ 'time' ] + $ savedToken [ 'lifetime' ] ) { $ savedToken [ 'token' ] = '' ; } return $ token === $ savedToken [ 'token' ] ; } return false ; }
Is token valid.

@param string $name
@param string $token
@return bool
Is token valid .