How to do CSRF protection in cakephp

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to do CSRF protection in cakephp

ye lu
         I am new to cakephp and now I am working on a new project with cakephp by studying. My current doing task is to do CSRF protection for overall project.I have read official cakephp 2 cookbook and I did as explained in that book. But, now I am facing 

The request has been black-holed

Error: The requested address '/admin/accounts/add' was not found on this server. 

every time the new user add form is submitted.
My code is :

public $components = array(
'Security' => array(
'csrfExpires' => '+1 hour'
'Search.Prg' => array(
'commonProcess' => array(
'paramType' => 'named',
'filterEmpty' => true



public function beforeFilter() {
$this->layout = 'admin';
$this->Security->blackHoleCallback = '_blackHole';


public function _blackHole($error) {


By doing so, 'auth' error has appeared.

How should I do?
Please help me.I have googled but it was just the waste of time.I have no way to do.
Please help me.

Like Us on FaceBook
Find us on Twitter

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at
For more options, visit