title: Adding Array like data in Zend Framework 2 Sessions
body: <p>Im wondering how to achieve the following:</p>
  
  <p>I have this Session Container created by a factory:</p>
  
  <pre><code>        $container = new Container('Fans');
          $container-&gt;setExpirationSeconds('219867583');
          return $container;
  </code></pre>
  
  <p>then i'm creating an instance in my controller like this:</p>
  
  <pre><code>$this-&gt;sessionService = $this-&gt;getServiceLocator()-&gt;get('SessionService');
  </code></pre>
  
  <p>Now i want to add something to the Session:</p>
  
  <p>This one works fine:</p>
  
  <pre><code>$this-&gt;sessionService-&gt;team = 'TEST';
  </code></pre>
  
  <p>But what i want to achieve is the following</p>
  
  <pre><code>$this-&gt;sessionService-&gt;team[0] = 'Team Name 0' // This doesn't work;
  $this-&gt;sessionService-&gt;team[1] = 'Team Name 1' // This doesn't work;
  \Zend\Debug\Debug::dump($this-&gt;sessionService-&gt;team);
  </code></pre>
  
  <p>The Output looks like this:</p>
  
  <pre><code>&lt;pre&gt;string(9) "TEST" &lt;/pre&gt;
  </code></pre>
  
  <p>I don't know if i misunderstood something or do something wrong.</p>
  
  <p>Does anybody know how to do it right ?</p>