title: Making file_get_contents() session aware in PHP
body: <p>Preamble: My app is mod_rewrite enabled and I have index.php page that downloads vaious pages based on Request_URI and prints them as page content.</p>
  
  <p>Problem: File() or File_get_contents() function is excellent at downloading my other app pages. But as soon as I try to use it to <strong><em>download a page that is session enabled</em></strong>, I start having problems.</p>
  
  <p>The main problem is that when I try to pass existing session id to url from the page I download, e.g.</p>
  
  <pre><code>  $url = "http://localhost/EmplDir/AdminMenu.php";
    return implode('',file($url. "&amp;" . session_name() . "=". session_id()));
  </code></pre>
  
  <p>My page never loads (or file() never loads content).
  I suspect I shoud use curl functions here, but it has too many options.
  My be an advice which <strong>curl options</strong> to use to make downloadable pages know about current PHP session would be helpful.</p>
  
  <p>P.S. The above seems to be true both for Windows and Linux.</p>