I check the login against the database, make a random HASH number, write that hash to the cookie, then write that hash to the database along with an IP and an expiration date.
Then on every page load I check the hash in the cookie, and the IP against the one in the database, and then update the expiration date. (20 minutes, 2 hours, 8 hours, whatever works for you)
And remember the password and login areas are the first weakness for SQL injection exploits, so do something like:
$value = preg_replace('!\\+|/+!', '', $value);
Against the password and the login.
Good luck