0
votes

I am debugging using the security component. I have a very simple login form on my home page and when I create the form using:

echo $this->Form->create('User', array('class'=>'form','url' => array('controller' => 'users', 'action' => 'login')));

there is NO appending to url, that is when I look at fields in FormHelper $fields, the first element looks like this:

[0] => /users/login

However, when posting my credentials, the _validationPost in the security component looks like this:

[0] => /users/login?url=users%2Flogin

The request gets Black-Holed.

If I call login from the User Controller as: /users/login I get:

[0] => /users/login?url=users%2Flogin

and I don't get black-holed as my form create looks like this:

echo $this->Form->create('User', array('class'=>'form'));

I'm using Max OS X (Mavericks). I'm not sure if this is a configuration issue.

Thanks for any help or guidance.

1
Looks like it could be a mod_rewrite/non-pretty URL issue, depends on your version and configuration... that being said, please always mention the exact CakePHP version you are using and tag your question accordingly! - ndm
Sorry, I have tried this in both 2.5.1 and 2.5.2. I will investigate mod_rewrite and post back if I find anything. - bk256
Well, if you're using 2.x then that's probably not the problem, at least not in the way I was thinking about it, as CakePHP 2.x doesn't use the url parameter in the rewrite rules anymore, still worth checking it out though. - ndm
Thank you for the pointer. It was indeed an issue with how i had set up my mod_rewrite. More specifically, it was in my .htaccess. I was using a very old version of .htaccess. Once I updated, it worked as expected. Thank you!!! - bk256
You're welcome. So you were probably using the .htaccess file of an older 1.x CakePHP version? I'd suggest that you add that as an answer and accept it later on so that the question appears resolved. - ndm

1 Answers

0
votes

The answer to this issue was indeed related to mod_rewrite. I was using an older version of .htaccess (from cakephp version 1.x). Once I updated the .htaccess in the webfoot folder, my issue was resolved.