// al guardar $foo = new StdClass; $foo->does = 'nothing'; $_SESSION['candy'] = serialize($foo); // y al recuperar $bar = unserialize($_SESSION['candy']); echo $bar->does; // nothing