Session object





10
Date Submitted Tue. Jul. 25th, 2006 11:39 AM
Revision 1 of 1
Beginner soccer022483
Tags PHP
Comments 2 comments
I'm trying to load an object into a session variable.
Here's my code:

if(!isset($_SESSION['tree'])) {
$_SESSION['tree'] = new DBTree();
}
echo $_SESSION['tree']->sizeOf();

If the session variable isn't set, then it gets set and the echo works fine. But let's say I refresh the page, so the session variable is already set, so it skips the if statement, but the echo statement fails with error: "The script tried to execute a method or access a property of an incomplete object." Any help?

Austin Schneider

Comments

Comments A possible solution..
Thu. Jul. 27th, 2006 3:52 AM    Helper rastersize
  Comments Nope
Thu. Jul. 27th, 2006 11:25 AM    Newbie weirdbro

Voting