Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session var contains object = __PHP_Incomplete_Class Object?

Status
Not open for further replies.

LaundroMat

Programmer
Dec 2, 2003
67
0
0
BE
Hi,

Is it first of all possible to store an object in a session variable? Eg:
Code:
$user = new user();
// $user->login returns MSG_LOGGEDIN if ok.
if ($user->login($login, $pw) {
$_SESSION["user"] = $user;
}

On the page where I execute the above code, a print_r($_SESSION["user"]) gives me a correct overview of the object.

However, when moving to another page, the same print_r($_SESSION["user"]) gives me this:
Code:
__PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => user [login] => LaundroMat [userid] => 1 [loggedin] => MSG_LOGGEDIN )

I didn't find much about this via google. Anyone can explain what this means? Needless to say, the object is no longer accessible.

Thanks in advance!
 
Oops.

I should have looked at the serialize() function. [morning]
 
PHP will serialize for you automatically, so I doubt that is your problem. Does your code define the class before it invokes session_start()?

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top