Jump to content

PHP cURL CookieJAR


CerealBH

Recommended Posts

my cookie jar, is not saving the cookies?? i checked the permissions there shouldn't be a problem

 

$cr = curl_init($pof."inbox.aspx?");
curl_setopt($cr, CURLOPT_RETURNTRANSFER, true);        // Get returned value as string (don’t put to screen)
curl_setopt($cr, CURLOPT_USERAGENT,  $useragent); // Spoof the user-agent to be the browser that the user is on (and accessing the php script)
curl_setopt($cr, CURLOPT_COOKIEJAR, '/var/www/cookie.txt');    // Use cookie.txt for STORING cookies
curl_setopt($cr, CURLOPT_POST, true); // Tell curl that we are posting data
curl_setopt($cr, CURLOPT_POSTFIELDS, $data); // Post the data in the array above
$output = curl_exec($cr); // Execute!
//echo $output; // Spit out what we found
curl_close($cr); // Free the memory

$cr = curl_init($pof."basicsearch.aspx");
curl_setopt($cr, CURLOPT_RETURNTRANSFER, true);        // Get returned value as string (don’t put to screen)
curl_setopt($cr, CURLOPT_USERAGENT, $useragent); // Spoof the user agent
curl_setopt($cr, CURLOPT_COOKIEFILE, '/var/www/cookie.txt'); // Use cookie.txt for READING cookies
$output = curl_exec($cr);
curl_close($cr);
echo $output;

Link to comment
https://forums.phpfreaks.com/topic/145454-php-curl-cookiejar/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.