I'm using CI and I have a UserModel that selects the user based on login information and sets a userVO and add this userVO in a session like this:
$this->session->set_userdata('user', $userVO);
When I try to access this session it return me this error:
Message: main() [function.main]: The script tried to execute a method
or access a property of an incomplete object. Please ensure that the
class definition "UserVO" of the object you are trying to operate on
was loaded _before_ unserialize() gets called or provide a __autoload()
function to load the class definition.
I have found a "solution", I need CI to load the UserVO class before session class and it works.
The problem is that I have lots os VO classes and I'll need them inside the session and is a bad thing to autoload them because I won't need them all at the same time.
Is there any workaround?
Thanks in advance for any help.
I have lots os VO classes and I'll need them inside the sessionSidenote: keep in mind that CI's sessions are cookies, so are limited to the 4Kb or so amount of space. Unless you're using the database, of course.