Re: [PHP] objects stored in sessions
Just a customer of mine who said that he'll be running PHP 4 and 5 on the same server, and that he would share session data ;-) Bye. Julien.P 2008/4/7 Richard Heyes [EMAIL PROTECTED]: Have you seen how PHP makes difference between private, protected and public attributes of an object, into the session file ? There are special caracters before them to recognize them. So the question is : is PHP4 able to read such a session file ? And how will it interpret them when we ask him to unserialize data ? The question(s) should be Why would you want PHP4 to read a PHP5 session? and Why would you expect it to work?. If you want to transfer data between versions you may want to investigate XMLRPC. Or perhaps the somewhat more verbose SOAP. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] objects stored in sessions
Have you seen how PHP makes difference between private, protected and public attributes of an object, into the session file ? There are special caracters before them to recognize them. So the question is : is PHP4 able to read such a session file ? And how will it interpret them when we ask him to unserialize data ? The question(s) should be Why would you want PHP4 to read a PHP5 session? and Why would you expect it to work?. If you want to transfer data between versions you may want to investigate XMLRPC. Or perhaps the somewhat more verbose SOAP. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] objects stored in sessions
Have you seen how PHP makes difference between private, protected and public attributes of an object, into the session file ? There are special caracters before them to recognize them. So the question is : is PHP4 able to read such a session file ? And how will it interpret them when we ask him to unserialize data ? Cheers. Julien.P 2008/4/7 Kevin Waterson [EMAIL PROTECTED]: On Sun, 2008-04-06 at 11:02 -0400, Mark Weaver wrote: So, if I create a user object, set the properties of said user object and store that object in the user session will that object be available throughout the application from the session? http://phpro.org/tutorials/Introduction-To-PHP-Sessions.html#8 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] objects stored in sessions
Hi All, I've got something on my little mind, and please keep in mind I'm still somewhat new to PHP Oop, so please excuse my silly ass if I ask something that should be obvious. I've got an application that I'm re-writing from PERL to PHP Oop. At the beginning of the application, at log in, a session is created for this user. What I would like to do is create a user object and store object properties in that session. So, if I create a user object, set the properties of said user object and store that object in the user session will that object be available throughout the application from the session? thanks, -- Mark - the rule of law is good, however the rule of tyrants just plain sucks! Real Tax Reform begins with getting rid of the IRS. == Powered by CentOS5 (RHEL5) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] objects stored in sessions
Richard Heyes wrote: So, if I create a user object, set the properties of said user object and store that object in the user session will that object be available throughout the application from the session? Yes. Just remember to include the class definition before you start the session on subsequent pages, otherwise you will encounter problems. Or alternatively use __autoload() to allow the class code to be loaded when you start the session. sweet! thank you Richard. -- Mark - the rule of law is good, however the rule of tyrants just plain sucks! Real Tax Reform begins with getting rid of the IRS. == Powered by CentOS5 (RHEL5) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] objects stored in sessions
So, if I create a user object, set the properties of said user object and store that object in the user session will that object be available throughout the application from the session? Yes. Just remember to include the class definition before you start the session on subsequent pages, otherwise you will encounter problems. Or alternatively use __autoload() to allow the class code to be loaded when you start the session. -- Richard Heyes Employ me: http://www.phpguru.org/cv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] objects stored in sessions
On Sun, 2008-04-06 at 11:02 -0400, Mark Weaver wrote: So, if I create a user object, set the properties of said user object and store that object in the user session will that object be available throughout the application from the session? http://phpro.org/tutorials/Introduction-To-PHP-Sessions.html#8 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php