Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Cookie values with Zend Framework

Warning: Non-static method Zend_Controller_Request_Http::getCookie() should not be called statically in..

Iam trying the following to get Cookie values:

$cookieData = Zend_Controller_Request_Http::getCookie($key, $default);

is there an better way to this?

like image 850
opHASnoNAME Avatar asked Dec 02 '22 04:12

opHASnoNAME


1 Answers

getCookie() method is not static, it should be called on an object.

I believe this code is from your controller, so it should basically look like

$request = $this->getRequest();
$cookieData = $request->getCookie('someCookie', 'default');
like image 132
Vika Avatar answered Jan 15 '23 18:01

Vika