Same problem here - I used cURL to login to a phpBB forum (not hacking - just using one example) and then tried to retrieve a page that can only be accesed by members. But the page I got was the login page.
<?php
$url = "http://www.phpbb.com/phpBB/login,php";
$Data = "username=user&password=pass&login=Login";
$handle = curl_init();
curl_setopt ($handle, CURLOPT_URL, $url);
curl_setopt ($handle, CURLOPT_POST, TRUE);
curl_setopt ($handle, CURLOPT_POSTFIELDS, $Data);
curl_setopt ($handle, CURLOPT_HEADER, TRUE);
curl_setopt ($handle, CURLOPT_USERAGENT, "Mozilla/5.0");
curl_setopt ($handle, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt ($handle, CURLOPT_REFERER, "localhost");
curl_setopt ($handle, CURLOPT_CONNECTTIMEOUT, 4);
curl_setopt ($handle, CURLOPT_FAILONERROR, 1);
curl_setopt ($handle, CURLOPT_COOKIEFILE, "D:/xxx/cook.txt");
curl_setopt ($handle, CURLOPT_COOKIEJAR, "D:/xxx/cook.txt");
curl_setopt ($handle, CURLOPT_URL, "http://www.phpbb.com/phpBB/privmsg.php?mode=post");
curl_setopt ($handle, CURLOPT_POST, FALSE);
$file_contents = curl_exec($handle);
echo $file_contents;
curl_close($handle);
?>
The 1st curl_exec logs you in - but the 2nd one takes you back to the login page.
Any idea how to get this resolved ?