$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookieFileName); //$cookieFilename must be a path to a file with cookie data
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookieFileName);
//curl_setopt($curl, CURLOPT_COOKIE, $cookie); //you may also use this, here $cookie is a cookie string
curl_close($curl);
$data = curl_exec($curl);