View Single Post
  #6 (permalink)  
Old 06-20-2008, 08:48 PM
jweber jweber is offline
Senior Member
 
Join Date: Jun 2008
Location: Florida
Posts: 108
Default

The variable that holds the results of instantiating Zend_Session_Namespace is a Zend_Session_Namespace object. This variable respects the scope rules of any other variable. Part of instantiating this class is that it stores a value in the php $_SESSION array. So, for example, if you did:

Code:
$exampleNamespace = new Zend_Session_Namespace('example');
$exampleNamespace->fname = 'jweber';
You could get to that "jweber" by echoing out the class member "fname", or you could get to it by echoing out its corresponding key in the $_SESSION array, which in this case is $_SESSION['example']['fname']. $_SESSION['example']['fname'] has global scope while $exampleNamespace->fname has the scope associated with the variable $exampleNamespace. From what I recall of the ZF manual, they are discouraging accessing this value by directly interacting with the $_SESSION array.
Reply With Quote