PHP 4.0 Bug #6604 Updated: Restoration of object stored in session fails
| From: | sniper@php.net | Date: | Mon, 16 Oct 2000 15:13:32 +0000 |
| Subject: | PHP 4.0 Bug #6604 Updated: Restoration of object stored in session fails | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35143@lists.php.net to get a copy of this message | ||
ID: 6604
Updated by: sniper
Reported By: balazs.pataki@sztaki.hu
Status: Closed
Bug Type: *Session related
Assigned To:
Comments:
No feedback. Can not reproduce.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-09-20 19:27:34] sas@php.net
Works for me. Do you have session.auto_start enabled? Or do you run prepend scripts which call
session_start()/session_register()?
---------------------------------------------------------------------------
[2000-09-07 11:37:02] balazs.pataki@sztaki.hu
The following script causes an error, like:
Fatal error: The script tried to execute a method or access a property of an incomplete object.
Please ensure that the class definition test of the object you
are trying to operate on was loaded _before_ the session was started in
/dsd2/www/htdocs/cow/test.php on line 12
The script:
<?
class test {
var $x;
}
session_register ("sessVar");
if ($sessVar == null) {
$sessVar = new test();
$sessVar->x = "foo";
echo "foo set. Reload!";
}
else {
echo $sessVar->x;
}
?>
Here we tried to store a simple object in the session. The first time the script is invoked it
creates a new test object and echos "foo set. Reload!". Then, reloading the script causes
the error message shown above. Sessions with normal (not objects) variables work OK.
This script fails with 4.0.1pl2 as well.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6604