...

View Full Version : PHP_Incomplete_Class_Name when accessing object via session



Exodious
01-04-2004, 09: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;

mordred
01-04-2004, 10: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.

shra
12-13-2014, 12:00 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum