#28533 [Fbk->Opn]: Object variables not being saved in session properly
ID: 28533
User updated by: dayal at capital-merchant dot com
Reported By: dayal at capital-merchant dot com
-Status: Feedback
+Status: Open
Bug Type: Class/Object related
Operating System: Windows XP
PHP Version: 4.3.5
New Comment:
Will this CVS snapshot solve this problem?
Is this a php bug?
Please explain
Previous Comments:
------------------------------------------------------------------------
[2004-05-26 19:25:47] iliaa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2004-05-26 17:37:10] dayal at capital-merchant dot com
Description:
------------
I have a php class Customer which has and Object variable 'Address'.
The class 'Address' in turn has an object variable 'Zip'.
Customer
Address
Zip
In the file 'CustomerTest.php' -
I am creating a new Zip object and assigning this zip object to a new
Address object which in turn is assigned to a new Customer object.
Now I am printing the instance variables of the Zip object (two String
values). After this I am assigning a new Zip object to the above
'Address object' and again printing the instance variables of the Zip
object to the screen. As expected these values differ from the above
print command.
Now I am assigning the Customer object to SESSION. Now on a different
php page using the Customer object stored in session, if I print the
instance variables of zip object, I get the OLD VALUES but not the new
ones which I have modified.
I reproduced the same code using servlets which functioned properly as
expected unlike php.
Please look into this.
Reproduce code:
---------------
http://198.92.233.203/temp/CustomerTest.php
Expected result:
----------------
Zip1: 333
Zip2: 444
Actual result:
--------------
Zip1: 123
Zip2: 345
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28533&edit=1
Thread (9 messages)