php - How to use cookies in Zend? -
how use zend_http_cookie set , read cookies?
i trie set cookie this:
$cookie = new zend_http_cookie('testcookie','testvalue','localhost.com')
no cookie generated. how read cookies zend?
thanks
as far know there not "setcookie" class in zend framework. use "plain" php:
setcookie('cookiename', 'value', 'lifetime', 'path', 'domain');
to read cookie, can use zend_controller_request_http();
example:
$request = new zend_controller_request_http(); $mycookie = $request->getcookie('cookiename');
Comments
Post a Comment