php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9583 session variables not kept when using $HTTP_SESSION_VARS and register_globals
Submitted: 2001-03-06 11:36 UTC Modified: 2001-06-12 17:16 UTC
From: sander at rotzorg dot org Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.4pl1 OS: Debian GNU stable with unstable
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sander at rotzorg dot org
New email:
PHP Version: OS:

 

 [2001-03-06 11:36 UTC] sander at rotzorg dot org
Hi,

i have this (sample) script:
<?php

session_name("gpixsessid");
session_start();

if (!session_is_registered("totalscore")) {
        session_register("totalscore");
        $totalscore = 0;
//      $HTTP_SESSION_VARS["totalscore"] = 0;
} else {
//              $HTTP_SESSION_VARS["totalscore"] += 10;
                $totalscore += 10;
}

$line = session_id() . "<br>\nScore:" . $totalscore;
//$line = session_id() . "<br>\nScore:" . $HTTP_SESSION_VARS["totalscore"];
?>

<html>
<body>
<?php echo $line ?>
</body>
</html>

If register_globals is On, everything works fine using the $totalscore global. But, if you change the comments, and use $HTTP_SESSION_VARS[] the sessiondata (totalscore) stays undefined.

If i change register_globals to Off (and restarting apache), the globals (surprise) don't work anymore, but $HTTP_SESSION_VARS do.

This is in contrast with the manual, saying that if register_globals is On, both $HTTP_SESSION_VARS and the global reference the same value.

gr,
Sander De Graaf

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-22 21:06 UTC] sbergmann@php.net
Please give the latest CVS a try. Andrei Zmievski committed a patch that should fix this problem.
 [2001-06-12 17:16 UTC] sniper@php.net
No feedback and should be fixed.
Reopen if not workie with PHP 4.0.6.

--Jani

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 12:01:29 2025 UTC