Re: [PHP] objects stored in sessions
- From: richardh@xxxxxxxxxxx (Richard Heyes)
- Date: Sun, 06 Apr 2008 16:14:45 +0100
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
.
- Follow-Ups:
- Re: [PHP] objects stored in sessions
- From: Mark Weaver
- Re: [PHP] objects stored in sessions
- References:
- objects stored in sessions
- From: Mark Weaver
- objects stored in sessions
- Prev by Date: objects stored in sessions
- Next by Date: Re: [PHP] Posting Summary for Week Ending 4 April, 2008: php-general@lists.php.net
- Previous by thread: objects stored in sessions
- Next by thread: Re: [PHP] objects stored in sessions
- Index(es):
Relevant Pages
|