SHA1 combined with a Salt should be strong enough to evade any standard dictionary attacks, although if someone has gained access to your database it is likley they also have access to your filesystem and therefore your salt.
If you wish to store credentials in a cookie you should use a salt and encode them like so:
// set cookie
$salt = 'NHx39sjHde';
$time = time();
$hash = sha1($salt . $username . $time);
setcookie('userdata', base64_encode("$hash-$username-$time"), time()+3600);
// retrieve cookie
$salt = 'NHx39sjHde';
if (isset($_COOKIE['userdata']))
{
$args = explode(base64_decode($_COOKIE['userdata']));
if (sha1($salt . $args[1] . $args[2]) == $args[0])
{
// authentic user
$username = $arg[1];
}
else
{
// remove bad cookie
setcookie('userdata', false, time()-3600);
}