title: session_start() messes up PDF download through PHP in IE8
body: <p>I use this code to send an PDF through PHP to the visitor ([link][1]):</p>
  
  <pre><code>session_start();
  
  $fileName = '0-1.pdf';
  $file = '../invoices/'. $fileName;
  if (file_exists($file)) {
    $size = filesize($file);  
    header('Content-Disposition: attachment; filename="'. $fileName .'"');
    header('Content-Length: '.$size);  
    header('Content-type: application/octetstream');
    #header('Content-type: application/pdf');
    echo file_get_contents($file);
  }
  </code></pre>
  
  <p>It works well on Chrome, FF and IE 9 but fails on IE 8.</p>
  
  <p>The reason it fails is</p>
  
  <pre><code>session_start();
  </code></pre>
  
  <p>If I leave it out, it will work in IE 8 as well.</p>
  
  <p>Unfortunately I need the session. Since the whole reason for passing the PDF through PHP is to perform an authentication check. So I need the session ID to check if the current user is allowed to access the PDF.</p>
  
  <p>Any ideas how to get the download to work in IE 8 with the headers session_start() sends?</p>