Witam wszystkich mam pewien problem, z logowaniem przez CURL do wordpressa. Ciagle wywala komunikat o wyłaczonych ciasteczkach w przegladarce. Czy ktoś spotkał się z problemem??

Mój kod wyglada nastepujaco:

 <?php

function wordpressLogin($username, $password, $loginUrl, $visitUrl, $userAgent, $cookieFile) {
    if (!function_exists('curl_init') || !function_exists('curl_exec')) {
        echo 'curl is not available!';
    }

    //$postData = "log=". $login_user ."&pwd=" . $login_pass . "&wp-submit=Log%20In&redirect_to=" . $visit_url;
    $postData = "log=$username&pwd=$password&wp-submit=Log+In&redirect_to=$visitUrl&testcookie=1";

    $ch = curl_init();

    //Url to use for login
    curl_setopt($ch, CURLOPT_URL, $loginUrl);

    //Activate cookiejar
    //curl_setopt($ch, CURLOPT_COOKIESESSION, true);

    //Set cookie
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile );

    //No need for SSL
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    //User agent
    curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);

    //Timeout
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);

    //Follow redirection
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

    //Return or echo
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    //Referer
    curl_setopt($ch, CURLOPT_REFERER, $loginUrl);

    //POST
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
    curl_setopt($ch, CURLOPT_POST, 1);

    //Save result to content
    $content = curl_exec($ch);

    //Close curl
    curl_close($ch);

    //Return content
    echo $content;
}

//Testing

$username = 'admin';
$password = 'admin';

$loginUrl = 'http://wordpress.pl/wp-login.php';
$visitUrl = urlencode('http://wordpress.pl/wp-admin');
$userAgent = 'Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0';
$cookieFile = '/tmp/cookies.txt';

wordpressLogin($username, $password, $loginUrl, $visitUrl, $userAgent, $cookieFile);

?>