title: ZF2 SessionManager usage
body: <p>I am new to ZF2 and not quite used to how to do stuff. I want to use session to keep track of an user (remember me). I had this code in one part of my class:</p>
  
  <pre><code>$sessionManager = new \Zend\Session\SessionManager();
  $sessionManager-&gt;rememberMe($time);
  
  // i want to keep track of my user id too
  $populateStorage = array('user_id' =&gt; $user-&gt;getId());
  $storage = new ArrayStorage($populateStorage);
  $sessionManager-&gt;setStorage($storage);
  </code></pre>
  
  <p>Ok, so far so good. When i try: </p>
  
  <pre><code>var_dump($sessionManager-&gt;getStorage());
  </code></pre>
  
  <p>I get the expected data.</p>
  
  <p>In another part of my program, i want to retreive my data again (a  bit like containers):</p>
  
  <pre><code>$sessionManager = new \Zend\Session\SessionManager();
  var_dump($sessionManager-&gt;getStorage());
  </code></pre>
  
  <p>This only returns an empty object.
  I guess this is due to the "new" and i think i have to implement SessionManager in a different way, but how? I do not know. This is what i came up with:</p>
  
  <p>In my Module i now have:</p>
  
  <pre><code>public function onBootstrap(\Zend\Mvc\MvcEvent $e)
  {
      $config = $e-&gt;getApplication()
              -&gt;getServiceManager()
              -&gt;get('Configuration');
  
      $sessionConfig = new SessionConfig();
      $sessionConfig-&gt;setOptions($config['session']);
      $sessionManager = new SessionManager($sessionConfig);
      $sessionManager-&gt;start();
  </code></pre>
  
  <p>In my module.config:</p>
  
  <pre><code>'session' =&gt; array(
      'remember_me_seconds' =&gt; 2419200,
      'use_cookies' =&gt; true,
      'cookie_httponly' =&gt; true,
  ),
  </code></pre>
  
  <p>But how to procede? How do i get the instance for my sessionManager?</p>