// cookie getter $string = $this->getRequest()->getCookie('mycookie'); // cookie setter $this->getResponse()->setCookie('mycookie', $value); // cookie setter with options $this->getResponse()->setCookie('mycookie', $value, $expire, $path, $domain, $secure);
If you want to manipulate cookies outside of an action, you will need to access theRequest
andAnswer
objects without shortcut:
$request = sfContext::getInstance()->getRequest();
$response = sfContext::getInstance()->getResponse();
Cheers!
Thanks I'd been looking for this a while
ReplyDeleteReally helpfull for beginners like me. Thank you.
ReplyDelete