Re: [PHP4BETA] Hooray: QQ RE: [PHP4BETA] Docs for sessions?
| From: | Sascha Schumann | Date: | Fri, 23 Jul 1999 13:33:21 +0000 |
| Subject: | Re: [PHP4BETA] Hooray: QQ RE: [PHP4BETA] Docs for sessions? | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-2605@lists.php.net to get a copy of this message | ||
> PHPLib allows storing of objects if certain helper fields are present which
> indicate the classname (perhaps this should be a built in object method to
> return the classname) and the names of the fields which should be stored
> (objects of which must follow the same rules). And of course methods are
> stored.
Methods (functions) are not stored by PHPLIB. There is no way to
serialize them. See the following piece from session.inc:
case "object":
## $$prefix is an object. Enumerate the slots and serialize them.
eval("\$k = \$${prefix}->classname; \$l =
reset(\$${prefix}->persistent_slots);");
$str.="\$$prefix = new $k; ";
while ( $l ) {
## Structural recursion.
$this->serialize($prefix."->".$l,&$str);
eval("\$l = next(\$${prefix}->persistent_slots);");
}
> BTW <%=sid;%> always returns a value even if cookies are used - the docs say
> it only returns a value of cookies aren't used. Sample page below. Reload
> it many times, the counter goes up but the sid is always present.
As I said twice before, you need to enable track_vars to make
that work currently.
--
Regards,
Sascha Schumann
Consultant