Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen I export files with php/html my session data resets
    primarykey
    data
    text
    <p>I have a web-based system built with user login data based on session variables.</p> <p>Sometimes when a user is logged in and tries to export tables to csv or xls the session data seems to wipe and the user is 'kicked out' of the system.</p> <p>This is the header code I'm using to serve the file.</p> <pre><code> header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Disposition: attachment;filename=file.xls"); header("Content-Transfer-Encoding: binary "); </code></pre> <p>If it helps it seems to be more prevalent on ie6. I was wondering if anyone has had similar issues.</p> <p>This is the latest header I've tried. Still no luck. Also tested the exact same procedure in FF/Opera/Safari and they're fine.</p> <pre><code>header('Cache-Control: no-store, private, no-cache, must-revalidate'); // HTTP/1.1 header('Cache-Control: pre-check=0, post-check=0, max-age=0, max-stale = 0', false); // HTTP/1.1 header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Expires: 0', false); header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT'); header('Pragma: no-cache'); header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition: attachment;filename=$fileName"); header("Content-Transfer-Encoding: binary "); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload