Tilted Forum Project Discussion Community

Tilted Forum Project Discussion Community (https://thetfp.com/tfp/)
-   Tilted Technology (https://thetfp.com/tfp/tilted-technology/)
-   -   [PHP] Classes/Objects and Sessions (https://thetfp.com/tfp/tilted-technology/69881-php-classes-objects-sessions.html)

Fallon 09-20-2004 05:32 PM

[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.

MrFlux 09-20-2004 05:58 PM

$object = new Object;
$_SESSION['object'] = $object;

Have you tried doing something like that?

MrFlux 09-20-2004 06:00 PM

Actually, I think you need to serialize the object before storing it in the session.

http://www.php.net/manual/en/languag...ialization.php

Fallon 09-20-2004 06:08 PM

I thought about tossing that in there, but I didn't know if I could.

Fallon 09-20-2004 06:12 PM

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:51 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37