title: How add a specific variable in custom AuthStorage in Zend Framework 2
body: <p>I'm working on ZF2 and I have developped my own storage for authentication but I wonder how to add a new persistent variable (session-like).</p>
  
  <p>Look My Auth Storage :</p>
  
  <pre><code>  &lt;?php
  
  namespace Application\Model;
  
  use Zend\Authentication\Storage;
  use Zend\Authentication\Storage\StorageInterface;
  use Zend\ServiceManager\ServiceManagerAwareInterface;
  use Zend\ServiceManager\ServiceManager;
  use Application\Model\User;
  
  class MyAuthStorage implements Storage\StorageInterface, ServiceManagerAwareInterface
  {
  
      protected $storage;
      protected $userTable;
      protected $resolvedIdentity;
      protected $serviceManager;
  
  
      public function isEmpty() {
          [...]
      }
  
      public function read() {
          [...]
      }
  
      public function write($contents) {
          [...]
      }
  
      public function clear() {
          [...]
      }
  
      public function getStorage() {
          [...]
      }
  
      public function setStorage(Storage\StorageInterface $storage) {
          [...]
      }
  
      public function getUserTable() {
          [...]
      }
  
      public function getServiceManager() {
          [...]
      }
  
      public function setServiceManager(ServiceManager $serviceManager) {
          [...]
      }
  }
  </code></pre>
  
  <p>I would like to add a variable called <strong>foo</strong> in my storage (my session ?)</p>
  
  <p>I try this, but it doesn't work :</p>
  
  <pre><code>protected $foo;
          public function setFoo($value) {
              $this-&gt;foo= $value;
          }
  
          public function getFoo() {
              return $this-&gt;foo;
          }
  </code></pre>
  
  <p>Any ideas ?</p>