We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Call to undefined method Cookies::setEncryption()

I'm getting Call to undefined method when calling setEncryption method on Phalcon\Http\Respone\Cookies(). Why is this happening?

E_ERROR: Call to undefined method Phalcon\Http\Response\Cookies::setEncryption()

$di->set('cookies', function() { 
$cookies = new Phalcon\Http\Response\Cookies();
return $cookies; 

Thanks in advance.

edited Jul '15


I noticed this typo in the documentatiom the other day and haven't got round to updating it. The method is actually called useEncryption(). You can also check if the class is already using encryption using the isUsingEncryption() method.