09-20-2004, 05:32 PM | #1 (permalink) |
Junkie
Location: RI
|
[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. |
09-20-2004, 05:58 PM | #2 (permalink) |
Fluxing wildly...
Location: Auckland, New Zealand
|
$object = new Object;
$_SESSION['object'] = $object; Have you tried doing something like that?
__________________
flux (n.) Medicine. The discharge of large quantities of fluid material from the body, especially the discharge of watery feces from the intestines. |
09-20-2004, 06:00 PM | #3 (permalink) |
Fluxing wildly...
Location: Auckland, New Zealand
|
Actually, I think you need to serialize the object before storing it in the session.
http://www.php.net/manual/en/languag...ialization.php
__________________
flux (n.) Medicine. The discharge of large quantities of fluid material from the body, especially the discharge of watery feces from the intestines. |
Tags |
classes or objects, php, sessions |
|
|