title: ZF2 get global session container
body: <p>I found how to get a session container like this:
  $session = new \Zend\Session\Container('base');</p>
  
  <p>But what if I need to access the session in many places during processing a HTTP request.
  Let's say in the Application module's indexAction in the IndexController, then I redirect it to the User\Controller\IndexController and need to access the session again, and then in a view helper or two, and who knows how often more.</p>
  
  <p>When constructing the session container every time anew, that is a waste of processing time. Yes, I debugged it to see what's going on in the constructor, and yes, there is some code executed behind the scenes. It is not as if the constructor would just return a global variable or something else which would be immutable and doesn't need a construction process.</p>
  
  <p>So what to do?
  Should I create a service for it?
  a controller plugin?
  a view helper?
  a service and a controller plugin and a view helper, with the latter calling the service?</p>
  
  <p>I'm sure it is something that many people must have come across and have dealt with, but I can't find any information on this.</p>
  
  <p>Any hint is dearly appreciated.
  Many thanks in advance! :-)</p>