![]() |
[PHP] Classes/Objects and Sessions
I'm trying to find out how to send an object into a session, but I'm not having any luck. I've looked on the PHP manual, but their message was to make sure the session.auto_start variable was set to 1, which I did, but I don't know what else to do.
Just a bit of a background of what I have. I have a login form. When you successfully login, it fills out the class. I need this class to get the other parts of the page, but if I need to, I can have it redo each request from the db... meh, maybe I'll do that, but I'll leave this question up. Thanks. |
$object = new Object;
$_SESSION['object'] = $object; Have you tried doing something like that? |
Actually, I think you need to serialize the object before storing it in the session.
http://www.php.net/manual/en/languag...ialization.php |
I thought about tossing that in there, but I didn't know if I could.
|
And damnit, I wish I knew about this function because it basically says what you need to do at the end of the offical manual and before the user comments. Thanks a bunch.
|
All times are GMT -8. The time now is 08:10 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project