Zend Framework 1.5 Session Namespaces
Of all the docs I've found (and devoured) on Zend Framework 1.5's Session namespaces, I cannot find anything on how to access a namespace once you're directed to another script.
Example:
in your Auth class, you authenticate the user, start the session, create the namespace, add values to the namespace and then redirect the user to the index page. From the index page, I am trying everything under the sun to access the values I applied to the namespace in the AuthController class and am having no luck
From my auth class:
// initiate sessions
require_once 'Zend/Session.php';
Zend_Session::start();
require_once 'Zend/Session/Namespace.php';
// processing and validation logic
// namespace assignment
$authNamespace = new Zend_Session_Namespace('Zend_Auth');
$authNamespace->setExpirationSeconds(720);
$authNamespace->userID = $employeeData->id;
$authNamespace->fName = $employeeData->sFName;
$authNamespace->lName = $employeeData->sLName;
$authNamespace->email = $employeeData->sEmail;
$this->_redirect('/');
Once the user is redirected, I am initiating the session within the bootstrap file.
Within my layout file (layout.phtml) I am doing the following with no luck:
From the bootstrap file (index.php):
// initiate sessions
require_once 'Zend/Session.php';
Zend_Session::start();
require_once 'Zend/Session/Namespace.php';
$authNamespace = new Zend_Session_Namespace('Zend_Auth');
From layout.phtml (output wrapper for all files, excluding login script)
<p id="logged-in">Logged in as <?php echo $this->escape($authNamespace->fName . ' ' . $this->escape($authNamespace->lName));?>.
What am I missing here?