Best method to make login in PHP

waveparticle

Active Member
Joined
Dec 4, 2013
Messages
96
Reaction score
0
What would be the best method to make a login system in PHP, with remember me?
My basic login is storing the username in cookies and sessions but I heard this is not secure at all.

What algorithm would you suggest to make a secure login system? I'm using prepared statements but the sessions and cookies are my problem.

When are cookies or sessions better used? In case of a Remember Me check box, is a cookie better?
 
Oh ye, the code example I posted requires you use javascript on the login page (to [-]encrypt[/-] hash the user input before sending), you can remove it you need to but you'll just have to adjust the code.
 
Last edited:
Would be awesome if people stopped refering to hashing as encryption ;)
 
Top
Sign up to the MyBroadband newsletter
X