PHP Password verify always returns false

前端 未结 2 1860
滥情空心
滥情空心 2021-01-18 12:09

I\'m using PHP\'s password hashing API to hash and verify my passwords on a site I\'m building, however whenever I try and verify my password it always returns false.

相关标签:
2条回答
  • 2021-01-18 12:33

    The given hash string example has 50 characters instead of 60. Double-Check the database - CHAR(60) - and var_dump($hash).

    0 讨论(0)
  • 2021-01-18 12:43

    Other problem that you can have, is when you reduce the cost in the server for gaining time.

    Always use password_hash($pass, PASSWORD_DEFAULT), is the best way.

    0 讨论(0)
提交回复
热议问题