Jump to content

readfile in IE clearing session


dc_jt

Recommended Posts

Ive got the following code which works fine in firefox, however in IE the file opens fine but for some reason it clears my session so once a user has downloaded the file, it logs them out the system.

 

Does anyone know whats causing IE to clear the session?

 

header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.basename($oDoc->document_name));
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: private');
    header('Pragma: private');
    header('Content-Length: ' . filesize($sUrl));
    
    ob_clean();
    flush();
    readfile($sUrl);
    exit;

Link to comment
https://forums.phpfreaks.com/topic/162380-readfile-in-ie-clearing-session/
Share on other sites

If I had to take a random guess, it would be the Expires line. I would remove that header and see if it makes a difference.

 

Thanks for the guess, I have tried that already but had no luck! Really dont know why it is doing it in IE. Does anyone have a script which they know definitely keeps the session data in IE??

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.