Wrong password error
Hi, I'm pretty a newbie of login scripts and I found me stuck in this kind of error.
when i register as a user through the registration form everything goes smooth, but when login is attempted the script always gives me the "wrong password" error. So to clear things up i printed the crypt() function and the associated hash on the db. This was the output for the user_name/password tuple zerrossetto/asd:
$6$rounds=5000$Bm82K7izI0KsiYFx$k.w6S8c8vxCi57mOEPiwONBcMqHaz0ewZZ5jt4h2nJH6NRoDd2qeKyIptG0DVvu4OAhx0apV3akG6jIiJo1xC/ $6$rounds=5000$Bm82K7izI0KsiYFx$k.w6S8c8vxCi57mOEPiwONBcMqHa
The two hashes coincide through the db-stored hash, does this mean that the comparison should be made using substr_compare() and not the "==" operator? Sorry disturbing you for this kind of problem but I'm genuinely curious since this is my first time on login scripts.
Thankyou.
Hey, the problem is, you have set your database hash field to char(60) (as stated in an old version of the script) but the database install scripts both clearly say user_password_hash char(118). So, you simply have mixed 2 different versions of the login script.