Sessions + Classes
| From: | PHP4Beta List | Date: | Thu, 02 Mar 2000 22:15:52 +0000 |
| Subject: | Sessions + Classes | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-11399@lists.php.net to get a copy of this message | ||
We are having problems accessing registered variables within classes.
class foo{
function foo() {
session_start();
echo session_id()."<br>\n";
echo session_is_registered("cnSession_time")."<br>\n";
echo $cnSession_time."<br>\n";
}
}
outputs:
dfkhfdaadfkj[whatever]adfkafd
1
[nothing here]
I can look at the session /tmp file and am sure that that variable is in fact in the file and set to
a value, but it doesn't seem to be accessable to this function. Is there some scoping
wierdness that I'm not getting right? I've tried declaring the variable as global within
the function, declaring the variable in the class, but no luck.
--
---------------------------------------
Matt Phillips
Perfect Order Inc.
---------------------------------------