Authentication

Authentication over PHP is already made easier by built in functions for hashing and comparing hashed passwords.

password_hash() hashes a password based on a given algorythm. This is used for saving passwords initially.

password_verify() gets a password, hashes it and then compares it to an already hashed password to check if the passwords match. If they do it gives back true, this is used for logins.

Explained in https://www.php.net/manual/en/ref.password.php

Sessions also important for auth lowk.

I should totally write an article on sessions.