I'm curious about a good way to do login with CodeIgniter.
I am currently trying the following: - Take a user's email and password from the login form - Encrypt that password, and compare it to the one in the DB.
However it returns false. I believe it is because the encryption method creates a new encrypted password every time.
I believe this is a good thing, but the only other way I can see to do a login is as follows:
- When the user submits the form to login, the form is validated
- The user in the DB with a matching username (or email address) is pulled and stored in a variable.
- The password that was pulled out is then decrypted and compared with the user trying to login
I am uncomfortable with this because it requires me to store an unencrypted password in a variable, potentially requiring a good hacker to only know a user's email address.
Suggestions?