I'm trying to use cookies on ZF2 but I have problems.
My way to create a cookie is like that :
$cookie = new SetCookie('locale', $locale, time() + 365 * 60 * 60 * 24);
$response = $serviceManager->get('Response')->getHeaders();
$response->addHeader($cookie);
The problem is when I try to read that nothing is shown. I read the cookie like that:
$cookies = $serviceManager->get('Request')->getHeaders()->get('Cookie');
$cookies->locale;
What's wrong??