PHP “Remember Me” security flaw?
问题 I'm in the middle of coding a 'remember me'-equipped login form, and so far the tutorials I've read (partly to make sure I'm doing it right) all say to store the encrypted password in a cookie along with the username. Then, each time PHP checks if the current user is not logged in, check their cookies and look for those values. If the username matches the password, you're in. To me, this is a gaping security hole. If somebody were to hack the database or somehow get access to the encrypted