if a cookie was previously set up php code example
Example 1: check if cookie exists php
if (!isset($_COOKIE["lg"])) {
setcookie("lg", "ro");
}
Example 2: cookie are not set in php
setcookie('username',$username,time()+60*60*24*365);
// 'Force' the cookie to exists
$_COOKIE['username'] = $username;