K
K
khodos_dmitry2021-01-05 19:53:38
Parsing
khodos_dmitry, 2021-01-05 19:53:38

Why does the invalid cookie domain (Session info: headless chrome=87.0.4280.88) error occur?

$client = \Symfony\Component\Panther\Client::createChromeClient(null, [
        '--window-size=1366,768',
        '--headless',
        '--disable-gpu',
    ],['port' => 9115]);

    foreach ($cookie_arr as $key=>$value) {
        $cookie = new Cookie($key, $value, null, '/', 'site.org');
        $client->getCookieJar()->set($cookie);
    }

    $crawler = $client->request('GET', 'https://site.org/page');

My cookies are stored in the $cookie_arr array.
I am using Symfony/Panther. The fifth parameter to the Cookie class is domain.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question