how to check whether cookies is exist or not in php code example Example: check if cookie exists php if (!isset($_COOKIE["lg"])) { setcookie("lg", "ro"); }