zend_session and scoping a single session object

1 message Options
Embed this post
Permalink
Joe Theplumber

zend_session and scoping a single session object

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
I have a standard MVC app and wanted to use session variables and haven't used the Zend_Session component so this will probably be a very naive question

Ideally, I'd like to be able to create a Zend_Session_Namespace in the index.php bootstrap file and be able to access in all the controllers, views, and view helpers.  It looks as if in the docs that in each location you need to instantiate the Zend_Session_Namespace object anew like so        

$sess=new Zend_Session_Namespace(); 

with the same name as the object in the index.php file. Is there any way to just make it globally availabe so that the above line doesn't need to be called?

thanks,

jonathan