CakePHP password hash issue

Posted in CakePHP on 13.11.2008.

Every now and then, a question of "weird password issue" with CakePHP comes up, with the symptom of password hash being displayed in the password form field.

The solution to the problem mentioned above is very simple, as things always are with CakePHP.

The cause of the problem is AuthComponent, which hashes your password. The solution? Simple!

Instead of this:

echo $form->input('User.password');

Use this:

echo $form->input('User.password', array('value' => ''));

And voila: the password is never sent to the browser. This is a very good thing to do, even if you don't have a "hash issue", because it also improves your security (or privacy) a bit.

Happy baking!

Article comments — View · Add

No comments!