src/Extractor/HttpClient.php
private function getCookie($url, $httpHeader = [])
    {
        if (!empty($httpHeader['cookie'])) {
            $this->logger->info('Found cookie "{cookie}" for url "{url}" from site config', ['cookie' => $httpHeader['cookie'], 'url' => $url]);

            $cookies = [];
            $pieces = array_filter(array_map('trim', explode(';', $httpHeader['cookie'])));

            foreach ($pieces as $part) {
                $cookieParts = explode('=', $part, 2);
                $key = trim($cookieParts[0]);

                if (1 === \count($cookieParts)) {
                    // Can be a single value (e.g. secure, httpOnly)
                    $value = true;
                } else {
                    // Be sure to strip wrapping quotes
                    $value = trim($cookieParts[1], " \n\r\t\0\x0B\"");
                }

                $cookies[$key] = $value;
            }

            return $cookies;
        }

        return false;
    }
private function getCookie($url, $httpHeader = [])
    {
        if (!empty($httpHeader['cookie'])) {
            $this->logger->info('Found cookie "{cookie}" for url "{url}" from site config', ['cookie' => $httpHeader['cookie'], 'url' => $url]);

            $cookies = [];
            $pieces = array_filter(array_map('trim', explode(';', $httpHeader['cookie'])));

            foreach ($pieces as $part) {
                $cookieParts = explode('=', $part, 2);
                $key = trim($cookieParts[0]);

                if (1 === \count($cookieParts)) {
                    // Can be a single value (e.g. secure, httpOnly)
                    $value = true;
                } else {
                    // Be sure to strip wrapping quotes
                    $value = trim($cookieParts[1], " \n\r\t\0\x0B\"");
                }

                $cookies[$key] = $value;
            }

            return $cookies;
        }

        return false;
    }
private function getCookie ( $ url , $ httpHeader = [ ] ) { if ( ! empty ( $ httpHeader [ 'cookie' ] ) ) { $ this -> logger -> info ( 'Found cookie "{cookie}" for url "{url}" from site config' , [ 'cookie' => $ httpHeader [ 'cookie' ] , 'url' => $ url ] ) ; $ cookies = [ ] ; $ pieces = array_filter ( array_map ( 'trim' , explode ( ';' , $ httpHeader [ 'cookie' ] ) ) ) ; foreach ( $ pieces as $ part ) { $ cookieParts = explode ( '=' , $ part , 2 ) ; $ key = trim ( $ cookieParts [ 0 ] ) ; if ( 1 === \ count ( $ cookieParts ) ) { // Can be a single value (e.g. secure, httpOnly) $ value = true ; } else { // Be sure to strip wrapping quotes $ value = trim ( $ cookieParts [ 1 ] , " \n\r\t\0\x0B\"" ) ; } $ cookies [ $ key ] = $ value ; } return $ cookies ; } return false ; }
Find a cookie for this url.
Based on the site config, it will return the cookie if any.

@param string $url        Absolute url
@param array  $httpHeader Custom HTTP Headers from SiteConfig

@return array|false
Find a cookie for this url . Based on the site config it will return the cookie if any .