ID: 12230 Comment by: jason at thewebmark dot com Reported By: schmidt at ibou dot de Status: Closed Bug Type: Session related Operating System: HP Unix 10 PHP Version: 4.0.5 New Comment:
I would like to reaffirm that this is a bug, I've had the same problem storing objects in the session using PHP Version 4.3.4. My work around for the this problem was serializing the object and placing the resulting string in the session, and manually unserializing the object after pulling the string from the session. This bug appeared on the production environment running the php CGI on winnt This bug did NOT appear in my dev environment running php ISAPI, Ill be more than happy to provide init files and any other requested info. ---------------------------------------------------------- class Tester { function TestFunc() { echo "PHP is Busted"; } } session_start(); if(isset($_REQUEST[init])) { $us = new Tester(); $_SESSION[x] = serialize($us); // //$_SESSION[x] = $us; } else { $b = unserialize($_SESSION[x]); // //$b = $_SESSION[x]; print_r($b); } ------------------------------------------------------- Previous Comments: ------------------------------------------------------------------------ [2001-11-18 01:24:51] [EMAIL PROTECTED] This is not a bug. Please have a look at the error message: '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'. ------------------------------------------------------------------------ [2001-07-18 09:36:54] schmidt at ibou dot de I have the follow Problem: 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 /u4_1/www/rf/includes/all_sicherheit.inc on line 3 Very simple: In file 1: class foo { ... } $x=new foo $x->... = 123; session_register("x"); in 2. file: class foo { ... } echo $x->...; When I do a session_register("x") befor I printed $x->... it get the same error. Is there a Workaround? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=12230&edit=1