Bug #15983 Updated: session variables lost between pages
From: gearond at cvc dot net Date: Wed, 24 Apr 2002 13:56:00 +0000 Subject: Bug #15983 Updated: session variables lost between pages References: 1 Groups: php.bugs Request: Send a blank email to php-bugs+get-5823@lists.php.net to get a copy of this message
ID: 15983
Updated by: gearond@cvc.net
Reported By: sl@scrooge.dk
Status: Open
Bug Type: Session related
Operating System: Debian/Linux mips platform
PHP Version: 4.1.2
New Comment:
These two pages, s*1.php and s*2.php are called consecutively,
separately by the same browser with the SID in the cookie?
I thought sessions had to be accessed using a SID. At least, that is
the way I believe PHPLib does it, and PHP 4.x.x is supposed to be
exhibiting similar behavior, right?
If one script is including the other script, I don't know hwo that
would work.
Previous Comments:
------------------------------------------------------------------------
[2002-04-12 05:23:51] achim@ddd.de
what about this workaround:
--- page #1 ---
session_start();
$_SESSION["test"] = "some value";
---------------
--- page #2 ---
session_start();
print $_SESSION["test"];
---------------
this works well for us.
/achim
------------------------------------------------------------------------
[2002-04-05 03:50:23] sl@scrooge.dk
Even in PHP 4.2.0RC1 the bug is still there.
Nothing is changed.
Best regards,
Soeren,
------------------------------------------------------------------------
[2002-04-02 09:48:13] yohgaki@php.net
Could you try 4.2.0RC1?
Please visit http://qa.php.net/ for it.
------------------------------------------------------------------------
[2002-03-18 11:16:41] phpbug@ehrlichorg.com
Here is part of what is going wrong. PHP starts out with each session
variable appearing as a global and also in $_SESSION. Initially these
are linked by reference (not clear how) and contain the same data. On
my pages this linkage appears to get broken so the contents
$GLOBALS['S'] and $_SESSION['S'] are not the same. $GLOBALS contains
the latest data, $_SESSION contains the data as of the start of the
page. Consequently changes to the $_SESSION variable are not being
saved between pages.
My work around is to use the following at the end of each page for $S:
if ( !($_SESSION['S'] === $S) )
$_SESSION['S'] = $S;
This updates the contents of the $_SESSION variable if it is not longer
the same as the global.
Based on a comment from one of the developers, the problem may relate
to having a global declaration for a session variable that appears
outside a function scope. I have these declarations on each of my pages
because PHP used to require them.
------------------------------------------------------------------------
[2002-03-12 20:52:42] php@bradandkristin.com
I've had the same issue (see bug 15822, which was marked as a
duplicate, though nobody saw fit to tell me what it was a duplicate
of).
Anyone have a work-around?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15983
--
Edit this bug report at http://bugs.php.net/?id=15983&edit=1
Thread (46 messages)
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- Bug #15983 Updated: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Opn->Fbk]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Fbk->Opn]: session variables lost between pages
- #15983 [Opn->Fbk]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Fbk]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Fbk->Opn]: session variables lost between pages
- #15983 [Opn->Fbk]: session variables lost between pages
- #15983 [Fbk->Opn]: session variables lost between pages
- #15983 [Opn->Fbk]: session variables lost between pages
- #15983 [Fbk->Opn]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Opn->Csd]: session variables lost between pages
- #15983 [Csd]: session variables lost between pages
- #15983 [Csd->Asn]: session variables lost between pages
- #15983 [Asn]: session variables lost between pages
- #15983 [Asn->Fbk]: session variables lost between pages
- #15983 [Fbk->Opn]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Opn->Csd]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- #15983 [Csd]: session variables lost between pages
- #15983 [Com]: session variables lost between pages
- Bug #15983 [Com]: session variables lost between pages
| « previous | php.bugs (#5823) | next » |
|---|