0

Guys I have password verify in my login file

if($row['user_name'] === $name &&  password_verify($pass,password_hash $string)) {

But I have password hash in my signup modal.php how do I import the $password string which have password hash from signup file to login if I include the signup file it takes the full form at here for signup and the session some guys reffered me to not use session on password I wanna know how will I get the password hash string to my login file from.signup without session or file include

yivi
  • 42,438
  • 18
  • 116
  • 138
  • 1
    The hashed password is the string you should be storing in your database along with the user name which it is associated with. – Nigel Ren Sep 30 '21 at 12:13
  • Yes it is storing hashed pass by signup file but for password verify i have to take the password hash variable into login file – Gujjar Sab Sep 30 '21 at 12:30
  • Which I cannot take by including signup file as the function break – Gujjar Sab Sep 30 '21 at 12:30
  • And also it doesn't work with storing the hash password variable in a session – Gujjar Sab Sep 30 '21 at 12:31
  • `for password verify i have to take the password hash variable into login file `....you do that by selecting it from the correct row in the database. Obviously in 99% of login scenarios it would not work to use the session because the user would not have visited the sign-up page in the same session, so it makes no sense to even think of doing it like that. – ADyson Sep 30 '21 at 12:50
  • Oh ok do I have to select the hashed password ya if I'm not mistaking @adyson – Gujjar Sab Sep 30 '21 at 13:10
  • Yes you do. And you can use the username that the user enters into the login form to find the right row in the database – ADyson Sep 30 '21 at 14:02
  • P.s. did it not occur to you that users would mostly log in without visiting the signup page first? You only sign up once but you can log in many many times after that – ADyson Sep 30 '21 at 14:03
  • Yes but how will I do the password find by username is there any tutorial @ADyson – Gujjar Sab Sep 30 '21 at 14:32
  • It's a simple SELECT query with a WHERE clause. If you're not experienced with SQL then take some classes – ADyson Sep 30 '21 at 14:53

0 Answers0