Hey Guys,
Having a bit of a problem using Zend Session namespaces:
ToolsController.php
PHP Code:
<?php
/** Zend_Controller_Action */
require_once 'Zend/Controller/Action.php';
class ToolsController extends Zend_Controller_Action
{
public function indexAction()
{
}
public function mailAction()
{
require_once 'Zend/Session.php';
require_once 'Zend/Session/Namespace.php';
$this->view->authNamespace = new Zend_Session_Namespace('User');
}
}
mail.phtml
PHP Code:
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Neranjara.org using Zend Framework</title>
</head>
<body>
<h1>Neranjara.org - Mail Diagnostics</h1>
<?php
if (isset($this->authNameSpace->userName))
{
echo $this->authNameSpace->userName;
}
else
{
?><p>Fail!</p><?php
}
?><pre><?php
var_dump($_SESSION);
?>
</pre>
</body>
</html>
If you check the page,
http://zend.neranjara.org/tools/mail after logining in to,
http://zend.neranjara.org/user/, (test/test123) you'll see that the session data is being stored without issue. However I cannot successfully initiate the 'User' name space.
Any help is greatly appreciated!