#41302 [Opn->Bgs]: Class properties in $_SESSION cause whole class to be included
ID: 41302
Updated by: tony2001@php.net
Reported By: gerard dot payne at nellies dot jp
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Red Hat
PHP Version: 4.4.7
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2007-05-06 08:09:53] gerard dot payne at nellies dot jp
Description:
------------
When trying to store class property values in $_SESSION the whole class
is put into session.
Reproduce code:
---------------
for($i=0; $i <= $this->numItems;$i++){
$_SESSION['cart']['numItems'] = $this->numItems;
$_SESSION['cart']['items'][$i]['isbn'] =
$this->items[$i]['isbn'];
$_SESSION['cart']['items'][$i]['quantity'] =
$this->items[$i]['quantity'];
}
Expected result:
----------------
Array
(
[numItems] => 1
[items] => Array
(
[1] => Array
(
[isbn] => BR15609
[quantity] => 1
)
)
)
Actual result:
--------------
Array
(
[cart] => shoppingcart Object
(
[numItems] => 1
[items] => Array
(
[1] => Array
(
[isbn] => BR15609
[quantity] => 1
)
)
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41302&edit=1
Thread (2 messages)