Possible Duplicate:
What is the best way to implement “remember me” for a website?
Every user has unique 32 chars id (made of like this: md5("salt" . $username . $user_password . "salt2");
). And I store this value under 'unique_id' field in table users. Is it a good way to assign this value to user's cookie and let him be logged in only if he has it assigned? And of course check it if that value exists in database?
I don't think it's a a good practise, because if someone steals your cookie, they will be able to log in to your account.
What's the other/better solution? Of course the safest thing is probably just to store it in sessions, but I want to implement this remember me feature.
Thanks.