checking cookie set in php the cookie set is checked for cookie name Here ‘user’ is the cookie name and cookie value is the username Source code $cookie_value = 'user_name'; setcookie('user', $cookie_value, time() + (60 * 10), "/"); // 86400 = 1 day if(!isset($_COOKIE['user'])) { header('Location:index.php'); exit; }else{ header('Location:assets.php'); exit; }