I am trying to remove cookies from my controller UserController
for ZfcUser
Module.
When the user logs out, I want to delete all cookies.
For example, I am setting cookies in the view:
setcookie("var", $value);
LogoutAction :
public function logoutAction()
{
$this->zfcUserAuthentication()->getAuthAdapter()->resetAdapters();
$this->zfcUserAuthentication()->getAuthAdapter()->logoutAdapters();
$this->zfcUserAuthentication()->getAuthService()->clearIdentity();
$redirect = $this->params()->fromPost('redirect', $this->params()->fromQuery('redirect', false));
if ($this->getOptions()->getUseRedirectParameterIfPresent() && $redirect) {
return $this->redirect()->toUrl($redirect);
}
return $this->redirect()->toRoute($this->getOptions()->getLogoutRedirectRoute());
}
Zend\Http\Header\SetCookie
? – blackbishop