Re: PHP 4.0 Bug #5152: Object passed in a session
| From: | php4 at developersdesk dot com | Date: | Fri, 23 Jun 2000 00:11:04 +0000 |
| Subject: | Re: PHP 4.0 Bug #5152: Object passed in a session | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22038@lists.php.net to get a copy of this message | ||
Addressed to: Bug Hunter <bughuntr@one.ctelcom.net>
php-dev@lists.php.net
> > And I repeat. My main point here was to maintain a connection between the
> > class definition and the object data. That would make it possible to
> > autoload them or provide user controlled loading without needing to keep
> > track of which file might define which class.
> >
> > -Rasmus
>
> I agree. I would carry it farther, and allow the functions to be
> serialized totally, so that the text or opcodes made it in with the
> data. However, that is details.
>
You are aware that keeping the code with the data means storing a
_separate copy_ of the code for each and every session that is in
storage, right? For long duration sessions on big sites, that could be
hundreds or even thousands of copies of the object method code in
session storage.
What a waste!
What if you find a bug and update the original methods? How do you
make sure your objects use the latest & greatest code, or do you just
leave half a dozen different versions of method code in the session
data store - bugs and all? What if an old method doesn't work with the
latest copy of the program that calls it?
What is so complex about having to require() the object definition
before you session_start()? It seems like the Right Thing(TM) to me!
Declare it or don't use it!!! Sessions are for DATA.
I do like the idea of being able to ignore some of the object data, not
declare it, not use it, and still be able to use it later, in a
different page; but that has nothing to do with method code.
Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com