Hello,
Is storing username & password of the user in a cookie a good practice? I really want to know how big websites like (Facebook, digg, twitter) handle this. My code is like that:
<?php
$username = mysql_real_escape_string($_POST['username']);
$password = md5($_POST['password']);
?>
After every successful login i store the $username
and the $password
(md5) in a cookie. And regenerate the session id with session_regenerate_id()
And to authenticate the user i check if a login session exists, otherwise i authenticate the cookies.
Any ideas? Thanks