Re: [PHP4BETA] Session Variables in classes
| From: | Kristian Koehntopp | Date: | Sat, 04 Mar 2000 06:29:49 +0000 |
| Subject: | Re: [PHP4BETA] Session Variables in classes | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11507@lists.php.net to get a copy of this message | ||
Richard Lawley wrote:
> Is it possible to have a class member variable made into a
> session variable?
Having anything but global variables as session variables is
pretty much useless. Session variables are suberglobals, an
extension of the concept of the global variable. Globals are
variables with a lifetime of the entire run and a visibility
throughout the whole program. Session variables extend this
concept by creating variables with a lifetime over multiple runs
of the same program and a visibility throughout multiple runs of
that program.
Saving a single member variable of an object is semantially
useless, because such a member variable would be pretty much
useless without the surrounding object. It is a component of a
compound type and saving only a single member in a session would
result in an incomplete type.
Saving an object, but not keeping the values of all member
variables or - alternatively - creating pre-save and post-load
wrapper functions which may prepare an object for cold storage
and thaw it afterwards are another thing and have been discussed
on this list just a few days ago (but I do not remember what the
decision was).
Kristian
--
Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH
Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00
Using PHP3? See our web development library at
http://phplib.netuse.de/ (We have moved! Update your
bookmarks!)