How to send cookies with file_get_contents
First, this is probably just a typo in your question, but the third arguments to file_get_contents() needs to be your streaming context, NOT the array of options. I ran a quick test with something like this, and everything worked as expected $opts = array(‘http’ => array(‘header’=> ‘Cookie: ‘ . $_SERVER[‘HTTP_COOKIE’].”\r\n”)); $context = stream_context_create($opts); $contents = … Read more