How I use Zend_Http_Cookie to set and read cookies?
I trie to set cookie like this:
$cookie = new Zend_Http_Cookie('TestCookie','TestValue','localhost.com')
but no cookie is generated. Also how I read cookies with Zend?
Thanks
How I use Zend_Http_Cookie to set and read cookies?
I trie to set cookie like this:
$cookie = new Zend_Http_Cookie('TestCookie','TestValue','localhost.com')
but no cookie is generated. Also how I read cookies with Zend?
Thanks
As far as i know is there not "setCookie" Class in Zend Framework. Simply use "plain" php:
To read an cookie, you can use
Zend_Controller_Request_Http();
as Example:For Zend 1.12, there is a way to set cookies for the response object.
The link to the portion in the manual is included below. I've also attached their examples in case the page ever disappears.
http://framework.zend.com/manual/1.12/en/zend.controller.response.html#zend.controller.response.headers.setcookie
or
It is important to use Zend's objects and classes so that you don't run into issues when creating Tests ;)
From Zend's github issue about multiple cookies:
Looking at the docs for Cookie and remembering from past experience there isn't a way of telling a cookie object to be sent along with a Response.
I suggest just using
setcookie()
.