jonnnnyw / php-phantomjs

Execute PhantomJS commands through PHP
MIT License
1.44k stars 432 forks source link

Cookies is disabled. #178

Open vastolord opened 7 years ago

vastolord commented 7 years ago

request is giving you need to enable your cookies on your browser.How to turn on cookies in phantom js packages of yours ??? because my browser cookies is on.

yipwt79 commented 7 years ago

I think you can specify the cookie file as below:

$client->getEngine()->addOption('--config=//phantomjs-config.json');

Then inside the phantomjs-config.json

{ / Same as: --ignore-ssl-errors=true / "ignoreSslErrors": true,

/ Same as: --max-disk-cache-size=1000 / "maxDiskCacheSize": 1000,

/ Same as: --output-encoding=utf8 / "outputEncoding": "utf8",

"cookiesFile" : "/cookies/cookies.txt"

}