I explain my problem:
In a method call, when a user login, it create an object that I stored in a session variable in the future, like this:
$user = new User($id, $name, $email, $password, $level, $lang);
$_SESSION ['User'] = $user;
Then, in another page, I get my item in a variable:
$user = $_SESSION ['user'];
And when I do:
echo $user->id;
I get the following message:
Notice: main () [function.main]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "User" 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 do not understand why it does not. Someone has an idea?
Bookmarks