Does anybody try zf2? I can not understand new mechanism of using sessions in zf2. How can I write and read to/from the session in new zend framework?
Also I can not find any examples in the internet.
Does anybody try zf2? I can not understand new mechanism of using sessions in zf2. How can I write and read to/from the session in new zend framework?
Also I can not find any examples in the internet.
Definitely yes, you should use Zend\Session\Container
Container extends of ArrayObject and instantiates with
ARRAY_AS_PROPS
flag that means you can easily iterate through properties and read/write them, e.g.First argument is session namespace and second — Manager.
Manager
is a facade forStorage
andSaveHandler
and it's configured withConfigInterface
in order to save your session data in DB or Memcache server.