note 69908 modified in function.session-start by danbrown
| From: | danbrown@php.net | Date: | Mon, 20 Jun 2011 15:02:39 +0000 |
| Subject: | note 69908 modified in function.session-start by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180701@lists.php.net to get a copy of this message | ||
Another one bitten by the "a different domain name gives you a new session" in IE...
My site uses interactive PDF documents. A user saves data from them into FDF documents, and when
this happens, the site also includes the URL of the PDF in the FDF data (using the FDF
"/F" tag).
This URL is generated using the $_SERVER["HTTP_HOST"] value from PHP. For some
as-yet-undetermined reason, when my hosting provider updated PHP (I believe to 4.4.1), for a time
the $_SERVER["HTTP_HOST"] value apparently dropped the "www." from my domain
name. So, some FDF files were saved with this different URL value. Needless to say, when one of
these FDFs loaded the corresponding PDF, although the load and display of the PDF worked, any
subsequent save operation (which relies on current session information for validating the user,
etc.) initiated from within the PDF failed. The original session had been established for the
"www.example.com", but because the PDF URL lacked the "www.", PHP/IE had
established a new, essentially empty, session.
I scratched my head over this problem for months and only recently happened upon this fix. In my
case, manually patching the failing (binary) FDF files to include the "www." in the URL
for the PDF did fix it.
Hopefully someone else finds this helpful...!
--was--
Another one bitten by the "a different domain name gives you a new session" in IE...
My site uses interactive PDF documents. A user saves data from them into FDF documents, and when
this happens, the site also includes the URL of the PDF in the FDF data (using the FDF
"/F" tag).
This URL is generated using the $_SERVER["HTTP_HOST"] value from PHP. For some
as-yet-undetermined reason, when my hosting provider updated PHP (I believe to 4.4.1), for a time
the $_SERVER["HTTP_HOST"] value apparently dropped the "www." from my domain
name. So, some FDF files were saved with this different URL value. Needless to say, when one of
these FDFs loaded the corresponding PDF, although the load and display of the PDF worked, any
subsequent save operation (which relies on current session information for validating the user,
etc.) initiated from within the PDF failed. The original session had been established for the
"www.domain.com", but because the PDF URL lacked the "www.", PHP/IE had
established a new, essentially empty, session.
I scratched my head over this problem for months and only recently happened upon this fix. In my
case, manually patching the failing (binary) FDF files to include the "www." in the URL
for the PDF did fix it.
Hopefully someone else finds this helpful...!
http://php.net/manual/en/function.session-start.php