CakePHP Security component

04Nov09

Advanced: http://mooncakephp.wordpress.com/2009/11/06/續-security-component/

今天遇到了一個特別的 bug, 在一個 add 頁面, page load 沒有問題,
但submit 的時候卻白畫面, 有進過 controller 的 beforeFilter(),
但沒有進過controller 的 add.
答案是 Security compoent enable 了, 因為沒有使用$form->end()
令頁面沒有提交一組 hidden 的 hash code, CakePHP 以為是安全問題, beforeFilter 之後就 filter 了….

cookbook:

When using the Security Component you must use the FormHelper to create your forms. The Security Component looks for certain indicators that are created and managed by the FormHelper (especially those created in create() and end()).

 

 



No Responses Yet to “CakePHP Security component”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.