Losing Session Data when switching http to https
| From: | Mark Kirkwood | Date: | Mon, 27 Nov 2000 04:49:44 +0000 |
| Subject: | Losing Session Data when switching http to https | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-4750@lists.php.net to get a copy of this message | ||
Hi all,
discovered an interesting Php feature observed when using custom session handlers ( - The one Ying
from ZippyDesign wrote, but modified to use Pgsql.)
I am using Php 4.0.2 ( and 4.0.3p1 ) with apache 1.3.14 on Redhat 7.0 ( with its openssl 0.9.5a
bundle)
A page of the sort
<?
include("session_handler.php");
session_start;
$x = "test"
session_register("x");
header(" Location : https://" . $HTTP_HOST .
"/otherpage.php");
?>
produces the result $x = "" ( as opposed to "test" ) when the value of x is
echoed in "otherpage.php"
This seems only to happen when Php is compiled as DSO....( well actually I mean that I did not
observe this with Php 4.0.2 compiled as a module into apache 1.3.12 on Redhat 6.2 with openssl
0.9.6 - a few differences in versions there....sorry ...)
Changing the https -> http in to redirected URL "fixes" the problem - so does :
<?
include("session_handler.php");
session_start;
$x = "test"
session_register("x");
print("<meta http-equiv=\"refresh\" content=\"1;url= https://" . $HTTP_HOST . "/otherpage.php\"");
?>
Looks like the header call is discarding any previous headers set up.
I am not sure if this reproduces with the default "files" session handler ( will try it
out )...
Cheers
Mark Kirkwood
04 4742063
mark.kirkwood@hnz.co.nz