Certain pages of my website crash when I try to call the 'Security' component in any of the apps. For example in the AppController file, if I change the components definition from
var $components = array('Auth','Session','Email');
to
var $components = array('Auth','Session','Email','Security');
pages on my site that rely on POST data from other pages crash. All I get is a blank screen. In the \cake\libs\controller\components directory there 'security.php' is defined and stored.
Any ideas on what's causing this or how to approach this?
That is what the SecurityComponent is supposed to do.
It secures your application by adding 'tokens' to all of your forms to check if the form is 'valid' and has not been tampered with (e.g. Somebody added an additional field or value to the form with javascript).
It also checks if the posted form originates from a controller and/or action that is allowed to do so (allowedControllers)
If the requirements are not met, a 'blackHoleAction' is called that stops further actions.
Based on your usage of 'var $components', not 'public $components', it think you're running Cakephp 1.3 see the documentation for the SecurityComponent here: http://book.cakephp.org/1.3/en/The-Manual/Core-Components/Security-Component.html
Read the part on allowedControllers and allowedActions
It's also possible that you have an error somewhere in your script that is not visible because debugging is disabled. To enable debugging, change the debug level to 1 or 2 in your core.php config file;
app/Config/core.php set debug level to 2, with this line:
Configure::write('debug', 2);