php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7291 Session drop objects in 4.0.3, it works OK in 4.0.2
Submitted: 2000-10-17 14:37 UTC Modified: 2000-10-18 14:33 UTC
From: david at boe dot es Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.3pl1 OS: AIX 4.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at boe dot es
New email:
PHP Version: OS:

 

 [2000-10-17 14:37 UTC] david at boe dot es
The session funtionality drops any object type variables when accesed in the page. If the page doesn't access the object var, it doesn't deletes the object from the session file.

This behaviour began in 4.0.3 and is maintained in 4.0.3pl1. Reverting to 4.0.2 solves the problem.

I can't post the code, because it's too long, but I can work in a little script that reproduce the problem if you really need it.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-17 15:29 UTC] david at boe dot es
This script shows the behaviour: 

<?

class Cart {
        var $items;             /* array de articulos */

        function Cart() {
        /* object constructor */
                $this->init();
        }

        function init() {
        /* inicializa y resetea la cesta */
                $this->items = array();
        }

        function add($productid, $qty) {
        /* aM-qade un articulo a la cesta aM-qadiendo el numero de unidades*/
                if (isset($productid)) {
                        if (! isset($this->items[$productid])) {
                                $this->items[$productid]=0;
                        }
                        $this->items[$productid] += $qty;
                }
        }

}

session_start();
session_register("SESSION");

if (! isset($SESSION)) {
        $SESSION = array();
}

if (! isset($SESSION["cesta"])) {       // This is supposed to be executed
        echo "INITIALIZING CART<BR>\n"; // just 1 time in the session,
        $SESSION["cesta"] = new Cart;   // isn't it?
}


$SESSION["cesta"]->add('cameras',1);    // Add 1 to the 'cameras' item

echo "Cameras: ";
echo $SESSION["cesta"]->items['cameras'];
echo "\n";

?>

When executed with PHP 4.0.2 it increments the counter for the 'cameras' item in the items array of the 'cesta' object.

when executed with PHP 4.0.3 (or 4.0.3pl1), it always resets the counter and prints the "Initializing object" message.

Thanks for your help, and congratulations for your work...

BTW, any1 going to ApacheCON next week?



 [2000-10-18 14:33 UTC] sas@php.net
Fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 21:01:29 2024 UTC