Hi
i have login via curl ,after successful login i couldnt get home page content via curl once successful login ,it again said to login. how to maintain session and cookie when calling a api via curl. can anyone give a solution .
$ckfile = tempnam ("/tmp", "CURLCOOKIE");
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile); // The name of a file to save all internal cookies to when the connection closes
curl_setopt($ch, CURLOPT_HEADER,0); // TRUE to include the header in the output.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_AUTOREFERER,1);
echo $result = curl_exec($ch); //execute curl and store data in result