Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.0.2
-
Fix Version/s: 1.8.0
-
Component/s: Zend_Session
-
Labels:None
-
Fix Version Priority:Nice to Have
Description
Currently, the namespace component creates namespaces only at the root of the session:
$user = new Zend_Session_Namespace( 'user' );
=> $_SESSION['user'] = array()
What if I want to store data deeper in the auth node to just group it and reduce clutter (aka modules) and to be able to count the number of items/namespaces in a node:
$_SESSION['auth']['user']['id'] = 1; ([node][namespace][key] = value)
In the above case, it would be much more powerful to be able to create the namespace under the 'auth' node so we could configure the keys in the 'user' namespace. We could introduce an optional 'node' argument to the Zend_Session_Namespace::__construct(), like so:
$user = new Zend_Session_Namespace( 'user', 'auth' ); [create the user namespace under auth node - auth node created automatically if it does not exist in session]
We can even go as deeper as we could by specifying an intelligent node-path:
$user = new Zend_Session_Namespace( 'user', 'auth:node2:node3' ); (create the user namespace under $_SESSION[auth][node2][node3] - all created automatically if they do not exist in session)
I guess the above feature adds more muscle to the namespace component and enables us to use it more powerfully.
Thoughts...?
This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.