We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 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();
$cookies->setEncryption(false); 
return $cookies; 
});

Thanks in advance.



1.6k
Accepted
answer
edited Jul '15

Hi,

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.