| 
  | 
Zend Framework 2 Documentation (Manual) |   |  
  | 
File: /_sources/modules/zend.session.storage.array-storage.txt
| Size: | 848 | 
| Storage flags: | no_autoload,compress/gzip (52%) | 
:orphan:
.. _zend.session.storage.array-storage:
Array Storage
-------------
``Zend\Session\Storage\ArrayStorage`` provides a facility to store all information in an ArrayObject.  This
storage method is likely incompatible with 3rd party libraries and all properties will be inaccessible through
the $_SESSION property.  Additionally ArrayStorage will not automatically repopulate the storage container in
the case of each new request and would have to manually be re-populated.
Basic Usage
^^^^^^^^^^^
A basic example is one like the following:
.. code-block:: php
   :linenos:
   use Zend\Session\Storage\ArrayStorage;
   use Zend\Session\SessionManager;
   $populateStorage = array('foo' => 'bar');
   $storage         = new ArrayStorage($populateStorage);
   $manager         = new SessionManager();
   $manager->setStorage($storage);
For more information about the PHK package format: http://phk.tekwire.net