tags:

views:

20

answers:

1

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

A: 

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

dhofstet
oh ! I follow an example code from the book CakePHP Application Development by Packt, and it was del.
The book is about CakePHP 1.2 and there the method is named "del" (so the example is correct for Cake 1.2). But in CakePHP 1.3.x this method has been renamed to "delete".
dhofstet
ok. Thank you. I'm waiting for a new book !!