View Full Version : PHP_Incomplete_Class_Name when accessing object via session
01-04-2004, 10:01 PM
Hiya, I've tried storing a class object on the session, directing to another page and then restoring the class from the session but when trying to access its functions, get PHP_Incomplete_Class_Object error, any ideas?
Storing on session using $_SESSION["classObj"] = &$classObj;
01-04-2004, 11:52 PM
Shot in the dark: You need to include the class definition on each subsequent page where the object is restored from the class. Plus any class in the inheritance chain of that object, e.g. if "class Foo extends Bar", you need both Foo and Bar class definitions in each file.
And perhaps it's too trivial, but the classes must be included before the session is started.
You started session before including class defenitions. Also you can check PHP option session.auto_start in php.ini.
If it is impossible to include class defenitions before session vars load, you can try restore your object so it was described here - (link removed). It is on russion, but php code is short and clean.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.