Hi. Here's my problem - I'm trying to access a session namespace across actions. The ZF examples appear to work by generating NEW namespaces, but they only demonstrate this within one action - but how do I access an existing namespace from a separate action? Here's the code:
public function indexAction(){
$defaultNamespace = new Zend_Session_Namespace('dingdangdoo');
if (isset($defaultNamespace->numberOfPageRequests)) {
// this will increment for each page load.
$defaultNamespace->numberOfPageRequests++;
} else {
$defaultNamespace->numberOfPageRequests = 1; // first time
}
echo "Page requests this session: ",
$defaultNamespace->numberOfPageRequests;
}
This is fine - but if I want to make another Controller/Action pair, how would I access $defaultNamespace->numberOfPageRequests? Do I have to make a new instance of Zend Session Namespace?