为什么password_verify返回false?

2023-11-26

我在用着password_verify检查我的哈希密码。我有 PHP 5.5:

// get result row (as an object)
$result_row = $result_of_login_check->fetch_object();

// using PHP 5.5's password_verify() function to check if the provided password fits
// the hash of that user's password
if (password_verify($_POST['user_password'], $result_row->user_password_hash)) {
    // ...
}

我越来越false on password_verify。我已经检查过 posts 值和 mysql user_password_hash 返回。

我不知道为什么它返回 false。

有任何想法吗?


根据手册,问题可能出在您的列长度上:建议将结果存储在可以扩展超过 60 个字符的数据库列中(255 个字符是一个不错的选择)。 link

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么password_verify返回false? 的相关文章