note 43692 added to function.header
| From: | ian at iprcom dot com | Date: | Wed, 30 Jun 2004 14:29:26 +0000 |
| Subject: | note 43692 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-72175@lists.php.net to get a copy of this message | ||
I too wasted many days trying to get a generated PDF to appear in IE but kept getting the
"could not open" error message - it seems IE can't accept cookies and download files
at the same time!
The note from "s.j.eggen" below didn't help me, but see the note by "ned at
wgtech dot com"
in http://www.php.net/session_decode for the source
of the following decodesession function.
This worked perfectly for me as it doesn't set a session cookie in the header and allows you to
add any other Cache-Control headers you like:
<?php
require_once("$DOCUMENT_ROOT/decodesession.php");
//
// IE is broken with respect to cookies!!!!! AAARRGHHHH!!!!
//
$_SESSION = decodesession(
file_get_contents(
session_save_path() . '/sess_' . $PHPSESSID
)
);
// now use the session data to generate and output
// the pdf document...
?>
Note that any changes to the session variables won't be preserved in the session - so this is
only good for scripts that generate pages or files that contain no "onward" links.
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43692
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43692&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43692&report=yes
Search -- http://master.php.net/manage/user-notes.php