title: file_get_contents from url that is only accessible after log-in to website
body: <p>I would like to make a php script that can capture a page from a website. Think <em>file_get_contents($url)</em>.</p>
  
  <p>However, this website requires that you fill in a username/password log-in form before you can access any page. I imagine that once logged-in, the website sends your browser an authentication cookie and with every consequent browser request, the session info is passed back to the website to authenticate access.</p>
  
  <p>I want to know how i can simulate this behavior of the browser with a php script in order to gain access and capture a page from this website.</p>
  
  <p>More specifically, my questions are:</p>
  
  <ol>
  <li>How do I send a request that
  contains my log-in details so that
  the website replies with the session
  information/cookie</li>
  <li>How do i read the session
  information/cookie</li>
  <li>How do i pass back this session
  information with every consequent
  request (<em>file_get_contents</em>, <em>curl</em>) to
  the website.</li>
  </ol>
  
  <p>Thanks.</p>