| |
|
|
|
cURL Mailing List Monthly Index Single Mail
curl-and-php mailing list Archives
How do I keep the $_SESSION info when I curl?
From: Edward E. Murphy <ted_at_speak-tome.com>
Date: Mon, 4 May 2009 20:12:25 -0400
Hello all,
I have searched for this to no avail, please help.
I want to use cURL to redirect from one file to another. The redirect works
Here is what I am using now (doesn't work). The COOKIEJAR file at
<?php
// fileurl is http://www.live-answers.com/test1php
// this sets a bunch of $_SESSION cookie info
require_once 'init.php';
// use curl to redirect the url
function useCurl($URL)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"$URL");
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/myCurlCookie.txt" );
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/myCurlCookie.txt");
curl_exec ($ch);
curl_close ($ch);
}
// this calls the second test file, where the $_SESSION info is not
$URL="http://www.live-answers.com/test2.php";
useCurl($URL);
exit;
?>
Best regards,
Ted
_______________________________________________
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info