Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 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.
Fallon is offline  
Old 09-20-2004, 05:58 PM   #2 (permalink)
Fluxing wildly...
 
MrFlux's Avatar
 
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.
MrFlux is offline  
Old 09-20-2004, 06:00 PM   #3 (permalink)
Fluxing wildly...
 
MrFlux's Avatar
 
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.
MrFlux is offline  
Old 09-20-2004, 06:08 PM   #4 (permalink)
Junkie
 
Location: RI
I thought about tossing that in there, but I didn't know if I could.
Fallon is offline  
Old 09-20-2004, 06:12 PM   #5 (permalink)
Junkie
 
Location: RI
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.
Fallon is offline  
 

Tags
classes or objects, php, sessions


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 10:10 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54