public function logoutAction() { $auth = new AuthenticationService(); if ($auth->hasIdentity()) { $identity = $auth->getIdentity(); } $auth->clearIdentity(); $sessionManager = new \Zend\Session\SessionManager(); $sessionManager->forgetMe(); return $this->redirect()->toRoute('application/default', array('controller' => 'index', 'action' => 'index')); }
/** * {@inheritDoc} */ public function getIdentity() { return $this->authenticationService->getIdentity(); }