I have just tested your code (in two scripts) and it seemingly works fine.
$ cat test_session1.php
<?
require_once 'Zend/Session/Namespace.php';
$authNamespace = new Zend_Session_Namespace('Zend_Auth');
$authNamespace->user = "myusername";
?>
Username set.
$ cat test_session2.php
<?
require_once 'Zend/Session/Namespace.php';
$authNamespace = new Zend_Session_Namespace('Zend_Auth');
?>
Username is: <?= $authNamespace->user; ?>
I request session1 file, then request session2 file and i get back the
username set in session1 file.
Troubleshooting: do you have error's being suppressed by php (or are
redirected to the error_log? Perhaps the default /tmp location is not
writable? Are you sure you are working in an environment (valid
hostname) that can set cookies on your client (browser?)
These are a few of the outside factors that might affect your ability to
be able to use ext/session in general.
-ralph
minglee wrote:
Darby Felton wrote:
Hello,
Hi, Darby,
My error, I did what you suggest, but failed.
Try:
require_once 'Zend/Session/Namespace.php';
$authNamespace = new Zend_Session_Namespace('Zend_Auth');
echo $authNamespace->user;
Best regards,
Darby
minglee wrote:
Hi,
I have session problem, which may be stupid:
I set a session:
require_once 'Zend/Session/Namespace.php';
$authNamespace = new Zend_Session_Namespace('Zend_Auth');
$authNamespace->user = "myusername";
How can I retrieve it from ANOTHER page?
I used "echo $authNamespace->user;" but failed!
Anybody can answer?
Regards