$this->di->set('cookies', function(){
$cookies = new \Phalcon\Http\Response\Cookies();
return $cookies;
});
$this->di->set('crypt', function () {
$crypt = new \Phalcon\Crypt();
$crypt->setKey('#1dj8$=dp?.ak//j1V$'); // Use your own key!
return $crypt;
}, true);