I believe I encountered a similar problem, and the only solution I could come up with was to bypass the framework and simply assign:
$_SESSION = array(); to empty the session without resetting the state of the surrounding Zend\Session object. I am not proud of this solution! I would love to hear if there is a better way to empty the session contents without officially destroying the session. - Demian > -----Original Message----- > From: Griesi [mailto:ebert.ch...@gmail.com] > Sent: Thursday, October 25, 2012 9:30 AM > To: fw-general@lists.zend.com > Subject: [fw-general] Re: [ZF2] ZfcUser - Clear Sessions before login > > Sadly this does not work. It seems to be to late. If the Session is destroyed > using this Event it will also destroy a previously initiated Session for > ZfcUser and thus the login does not work. Does anyone have an idea? This is > the whole code: > > public function onBootstrap(\Zend\Mvc\MvcEvent $e) { > $app = $e->getParam('application'); > $em = $app->getEventManager()->getSharedManager(); > $em->attach('ZfcUser\Authentication\Adapter\AdapterChain', > 'authenticate.pre', function($e) { > $session = new \Zend\Session\Container('****'); > $session->getManager()->destroy(); > }); > } > > > > > -- > View this message in context: http://zend-framework- > community.634137.n4.nabble.com/ZF2-ZfcUser-Clear-Sessions-before-login- > tp4657794p4657796.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- > List: fw-general@lists.zend.com > Info: http://framework.zend.com/archives > Unsubscribe: fw-general-unsubscr...@lists.zend.com > -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com