dc_jt Posted June 16, 2009 Share Posted June 16, 2009 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; Quote Link to comment https://forums.phpfreaks.com/topic/162380-readfile-in-ie-clearing-session/ Share on other sites More sharing options...
premiso Posted June 16, 2009 Share Posted June 16, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/162380-readfile-in-ie-clearing-session/#findComment-857129 Share on other sites More sharing options...
dc_jt Posted June 16, 2009 Author Share Posted June 16, 2009 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?? Quote Link to comment https://forums.phpfreaks.com/topic/162380-readfile-in-ie-clearing-session/#findComment-857136 Share on other sites More sharing options...
premiso Posted June 16, 2009 Share Posted June 16, 2009 What version of IE are you testing this on? Just another random guess, have you tried removing the Cache portion as well? Quote Link to comment https://forums.phpfreaks.com/topic/162380-readfile-in-ie-clearing-session/#findComment-857138 Share on other sites More sharing options...
dc_jt Posted June 16, 2009 Author Share Posted June 16, 2009 What version of IE are you testing this on? Just another random guess, have you tried removing the Cache portion as well? I have just tried it on a few other machines and it looks as though it is a problem with my IE! Thanks for the help anyway. Quote Link to comment https://forums.phpfreaks.com/topic/162380-readfile-in-ie-clearing-session/#findComment-857182 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.