Redirect with exit using cakephp
If you run redirect function on cakephp 1.1, don’t forget to add exit() function after redirect sintax. This thing can make security hole that confusing you. The purpose of adding exit() function after redirect sintax is to avoid php running others code after redirect function.
$this->redirect('controller/action');
exit();
However cakephp 1.2 give you default exit after redirect. The complete sintax for redirect on cakephp 1.2 is
$this->redirect('controller/action', null, true);
which the third parameter define exit = true, means terminate the script. second parameter is for setting exit status, for example 404, etc. Defaultly you only need to write
$this->redirect('controller/action');