IE Kills Session After Exporting CSV [CakePHP]

Go To StackoverFlow.com

1

i have a web application that export CSV and i logged in as admin but what happened during the exportation the IE opens a new tab and export the CSV but what happens next when you click any of the link on the web app you will automatically logout!

This only happen on IE.

here is the header i used:

header("Content-type:application/vnd.ms-excel");
header("Content-disposition:attachment;filename=".$this->filename);

I am using cakephp 1.3.x.x

TIA :D

2012-04-04 05:18
by vnpnlz
How one can solve your issue without looking inside the code. Do debugging, you will definitely find it - Shakti Singh 2012-04-04 05:20
Thanks Shakti i will put the code i use on header - vnpnlz 2012-04-04 05:26


1

I think the problem lies in "open a new tab". What you probably have is this new tab opening a new session, efectivelly killing the old one.

A solution can be to open new tab passing the SESSID as a parameter in the url of the new tab. So PHP detect correctly the session and don't create a new one.

2012-04-04 08:36
by Tei
thanks Tei.. but how can i do that? how can i pass session to a new tab - vnpnlz 2012-04-10 07:05
You can have something like this, this will add the session name=session id value to the url that opens your get your export script. So wen the export script start, PHP finds the session and don't create a new one.

Get CSVTei 2012-04-10 08:56

Tei what happpens now is that it "open in new window".. - vnpnlz 2012-04-12 00:48
try removing the target part :- - Tei 2012-04-12 13:38
i removed the target part but it doesn't help.. BTW thanks for helping me Tei... i appriciate all your effort : - vnpnlz 2012-04-13 08:28
Ads