I believe cURL is the best and easiest way to go for that.
here is an example of how you can Get cookies from first http web request and use those cookies in the second request:
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "http://www.YourRequestWebsite.com/");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// Here we store cookies sent from the server in th file "cookies.log"
curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookies.log');
/* You can do your cookies processing and manipulation if needed in that file content. */
/* and Here we "cookies.log" will be the source of cookies to be sent by our GET request.
* That makes both our sent/received cookies from and to the same file. */
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookies.log');
$output = curl_exec($curl);
$info = curl_getinfo($curl);
hope this gives you an idea on how to do it.