Bug #14928: Session variables are lost when using header() redirection(identical to #14636)
| From: | mikkoh at htklx2 dot htk dot fi | Date: | Tue, 08 Jan 2002 10:17:20 +0000 |
| Subject: | Bug #14928: Session variables are lost when using header() redirection(identical to #14636) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-76245@lists.php.net to get a copy of this message | ||
From: mikkoh@htklx2.htk.fi
Operating system: Linux (2.2.15)
PHP version: 4.1.1
PHP Bug Type: Session related
Bug description: Session variables are lost when using header() redirection(identical to #14636)
The symptoms are identical to bug #14636, but with versions 4.1x and on
Linux. Manual redirection works fine, but when using header("Location:
xxx") registered session variables are lost. All pre-4.1.x -versions seem
to work. Not tested on other platforms.
session.auto_start is set to 0 in php.ini.
Example:
script_1.php:
<?php
session_start ();
/* these session variables should be set in script_2.php.
On versions 4.1.x they never get set. On 4.0.x everything works. */
echo "FOO: " . $foo . " BAR: " . $bar;
?>
<html><head><title></title></head>
<body>
<form action="script_2.php">
<input type="text" name="param1">
<input type="text" name="param2">
<input type="submit" value="Submit">
</form>
</body></html>
Script 2:
<?php
session_start ();
session_register ("foo");
session_register ("bar");
$foo = $param1;
$bar = $param2;
header ("Location: $HTTP_REFERER");
?>
--
Edit bug report at: http://bugs.php.net/?id=14928&edit=1