php if cookie does not exist create code example Example: check if cookie exists php if (!isset($_COOKIE["lg"])) { setcookie("lg", "ro"); }