Got it fixed. Up and running! Two typos and one undocumented feature.
The undocumented feature revolved around secure passwords. I was using MySQL encrypt without a specified salt, and my database did not store that. So what happened was every time I tried to login, MySQL was generating a different password hash. Once I identified the issue, fixing it was easy.
This line was the problem:
INSERT INTO users (email, password) VALUES (
'sales@example.com', ENCRYPT('password'));
Add a salt field into the users database.
Add a salt into the ENCRYPT clause, and store it along with the password.
The MySQL becomes:
INSERT INTO users (email, password, salt) VALUES (
'sales@example.com', ENCRYPT('password', 'salt'), salt);
I've done this before with Ruby on Rails, so the concept was familiar.