I am trying to use the Security component in order to avoid CSRF attacks and if i use the formHelper to create the ticket just using a postLink, like this, it fails:
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $user['User']['id']), array('class' => 'button mini'), __('Are you sure?', $user['User']['id'])); ?>
I am not sure if this is possible or CakePHP just allow this feature using the create() and end() methods of formHelper.
CakePHP documentation only says that is is compulsory to use the formHelper but it doesn’t specify much more.
When you have the Security component enabled and you use the FormHelper methods for all forms you do not have to worry about this. You also do not have to configure anything. It works out of the box.
For CSRF you can use the following options:
If you have everything ON you should see the CSRF tokens in the html of the form. You can set any additional options you like but it will pretty much work out of the box for you.