io proverei così

function login(){
$visite = time();
$cookie_string = $_POST['nickname'].$_POST['pass'].$visite";
if (setcookie("genb", $cookie_string, time()+3600)) {
echo "Logging in...";
}
else{
echo "cookie NON impostato";
}
header("Refresh: 2; URL=index.php");
}