One way to start the session with Zend Framework 2 (2.0.3 dev) is as below written.
1 2 3 4
// public/index.php $manager = new \Zend\Session\SessionManager(); $manager->getConfig()->setCookieHttpOnly(true)->setName('ac-session'); $manager->start();
- Start the session manager
- Get the session config object
- Set httpOnly cookies for better xss security
- Set your session name
- Start the session
There are many other options which i have not tested yet, but this options are mandatory in my opinion.