|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28533 Object variables not being saved in session properly
Submitted: 2004-05-26 17:37 UTC Modified: 2004-12-21 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dayal at capital-merchant dot com Assigned:
Status: No Feedback Package: Session related
PHP Version: 4.3.5 OS: Windows XP
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.
Block user comment
Status: Assign to:
Bug Type:
From: dayal at capital-merchant dot com
New email:
PHP Version: OS:


 [2004-05-26 17:37 UTC] dayal at capital-merchant dot com
I have a php class Customer which has and Object variable 'Address'. The class 'Address' in turn has an object variable '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:

Expected result:
Zip1: 333
Zip2: 444

Actual result:
Zip1: 123
Zip2: 345


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-26 19:58 UTC] dayal at capital-merchant dot com
I haved used the latest CVS snapshot but the problem still persists...

Please advise
 [2004-07-05 11:29 UTC]
Please provide a self-contained script with which we can 
reproduce your problem.

 [2004-07-06 17:09 UTC] dayal at capital-merchant dot com
You can access the scripts @

Please respond if you need anything else..

 [2004-12-13 01:03 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

 [2004-12-21 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 15:01:32 2024 UTC