Bug #14928 Updated: Session variables are lost when using header() redirection(identical to #14636)

From: Date: Fri, 08 Feb 2002 02:23:16 +0000
Subject: Bug #14928 Updated: Session variables are lost when using header() redirection(identical to #14636)
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-79622@lists.php.net to get a copy of this message
 ID:               14928
 Updated by:       yohgaki@php.net
 Reported By:      mikkoh@htklx2.htk.fi
-Status:           Duplicate
+Status:           Bogus
 Bug Type:         Session related
 Operating System: Linux (2.2.15)
 PHP Version:      4.1.1
 New Comment:

This issue will not be able to be fixed by PHP.
Some browser does not set cookie for initial request.

To make sure cookie is enabled _always_, user must check it first.

http://www.zend.com/search_code_author.php?author=yohgaki

Use session helper html or other people post without JavaScript
version.


Previous Comments:
------------------------------------------------------------------------

[2002-02-07 05:38:58] betsos@westgate.gr

I don't think that this is a duplicate bug. Although the
symptomts are identical to bug #14636 the cause is not 
the same.

As of bug #14636 the cause was that session.auto_start
was set to 1 and despite this fact session_start was
used to initiate a session.

I have experienced exactly the same problem although in 
my php.ini session.auto_start is set to 0. The bug is
reproduced either with PHP 4.0.6 or with 4.1.1 and IIS
under NT 4.0.

However everything works OK with PHP 4.0.1 and Apache 
under Unix.

------------------------------------------------------------------------

[2002-01-29 13:58:12] jose@unigest.net

I'm having the same problem usign php 4.1.1 on Windows. I'm developing
a commercial application and when pass few minutes all session
variables are lost and I have to restart Apache to open a new session
and begin to work...

------------------------------------------------------------------------

[2002-01-08 07:22:50] sander@php.net

Dupe of 14363.

No need to report bugs which already have been reported.

------------------------------------------------------------------------

[2002-01-08 05:17:19] mikkoh@htklx2.htk.fi

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 this bug report at http://bugs.php.net/?id=14928&edit=1



Thread (6 messages)

« previous php.dev (#79622) next »