开发者

Fatal error: Call to undefined method CookieComponent::del()

开发者 https://www.devze.com 2023-01-19 10:17 出处:网络
Hi to all I have this strange error in my code. I want to make a cookie system with cakephp开发者_运维问答, and in app_controller.php I include

Hi to all I have this strange error in my code. I want to make a cookie system with cakephp开发者_运维问答, and in app_controller.php I include

var $components = array('Auth', 'Cookie'); var $helpers = array('Html', 'Form', 'Session');

but everytime I click on Logout link the error appears. This is the function

function logout() { $cookie = $this->Cookie->read('User'); if($cookie) $this->Cookie->del('User'); $this->Session->setFlash('Logout'); $this->redirect($this->Auth->logout()); }

Where I can look for a solution? Thank you dude


The method name is delete, not del, hence the error. See also http://api.cakephp.org/class/cookie-component#method-CookieComponentdelete

0

精彩评论

暂无评论...
验证码 换一张
取 消