I send a wav file to the browser by setting Content-type: audio/x-wav and readfileing the wav file out. Works fine, unless I put in a session_start in my code, then IE and IE derivitives blow up. I need the session info so I can tell if the user should be allowed to view the wav file (it's voicemail).
Surely this is a problem often encountered. Anyone have ideas for how to get this to work or work around it in a way that doesn't mean throwing away security?
I found a similar thread: (http://www.phpbuilder.com/forum/read.php3?num=2&id=139498&loc=0&thread=139498) but no one had an answer there.
Code that explains the problem:
<?php
If you uncomment this, it won't work in IE.
session_start();
Send a wav file.
header("Content-Type: audio/x-wav");
readfile("whatever.wav");
?>