View Full Version : Can I use $_SESSION to Store Objects?
01-09-2006, 08:36 PM
Can I use $_SESSION to store objects?
var $obj = new myclass();
$_SESSION['obj'] = $obj;
01-09-2006, 08:38 PM
You can serialize objects with serialize() (http://www.php.net/serialize) and store the output of that function.
01-09-2006, 08:39 PM
yes, but you need to call the class definition(s) prior to calling session_start (http://www.php.net/session_start). for this reason you cannot have session.auto_start ON in your php.ini.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.