Answer the question
In order to leave comments, you need to log in
Why doesn't php PhantomJS save cookies?
I'm trying to figure out PHP-PhantomJS ( jonnnnyw.github.io/php-phantomjs )
For the test, I created the following php page:
<?php
session_start();
setcookie('php', '1');
print_r(getallheaders());
?>
<script>
var cookieString = "js=1";
document.cookie = cookieString;
</script>
<?php
use JonnyW\PhantomJs\Client;
$client = Client::getInstance();
$client->getEngine()->addOption('--load-images=true');
$client->getEngine()->addOption( '--ignore-ssl-errors=true' );
$client->getEngine()->addOption('--ssl-protocol=any');
$client->getEngine()->addOption('--cookies-file=cookie.txt');
$client->getEngine()->addOption('--local-storage-path=storage');
$client->getEngine()->addOption('--web-security=false');
$response = $client->getMessageFactory()->createResponse();
$client->send( $request, $response );
[General]
[email protected](\0\0\0\x7f\0\0\0\x16QList<QNetworkCookie>\0\0\0\0\x1\0\0\0\0)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question