I have a mysql table with userid, usernames and passwords and if the given password matches with the given username I create 3 cookies:
use SHA1, coz it is better than md5 and is faster too !