drew010 wrote:you should at the least store an enctypted or hashed version of their password in a cookie and on each pageload make sure the password in the db matches up to the one in the cookie.
we may use several items in the match in addition to the password cookie. userid, user-email, user-password. userid and user-email are in plaintext in database, we can save them in cookie encrypted. password is already encrypted in the database, we can save the encrypted value directly, right?
the whole idea for the saving the encrypted value in cookie is that for prevent attackers who sign in as your user, and then analysis the cookie and then try to break into other users account, right?
if the clients computer is attacked by the attackers and his cookie is grabbed by the attacker, then encrypted or not encrypted cookie values, will that still make difference?
or with not encrypted cookie value, the attacker could sign in from his computer, but with encrypted value, the attacker has to pretend to sign in from the victim's computer? so encrypted cookie value still add a layer of the protection here?
drew010 wrote:sessions are also an okay idea, but by default a session ends when the browser is closed so unless you dont mind people logging in each time they come on you could use some sort of session authentication.
How about session fixation attack? PHP cookie is also under the "session fixation attack", or php cookie cannot be attacked by session fixation attack?
session id is a cookie, the when session fixation attack get your session id, does it mean it get your cookie, so php cookie is also attacked by session fixation attack method?
in the manual, session chapter has mentioned the session fixation attack. but cookie chapter doesn't, even cookie could set up to have a life time as session, but cookie has nothing to do with the session (or session fixation attacks)?
How session and cookie works in php? is using cookie a alternate approach to prevent session fixation attacks?
Thanks!