php.net |  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
Votes:1
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
13 + 1 = ?
Subscribe to this entry?

 
 [2004-05-26 17:37 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] moriyoshi@php.net
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 @ http://198.92.233.203/temp/CustomerTest.php

Please respond if you need anything else..

Thanks
Dayal
 [2004-12-13 01:03 UTC] sniper@php.net
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: Fri Mar 29 01:01:28 2024 UTC