public function addCookie($cookie)
{
$request = $this->getRequest();
if ($request->getEnableCookieValidation()) {
$value = $this->getApplication()->getSecurityManager()->hashData($cookie->getValue());
setcookie($cookie->getName(), $value, $cookie->getExpire(), $cookie->getPath(), $cookie->getDomain(), $cookie->getSecure(), $cookie->getHttpOnly());
} else {
setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpire(), $cookie->getPath(), $cookie->getDomain(), $cookie->getSecure(), $cookie->getHttpOnly());
}
}