Answers for "check if cookie is not set php"

PHP
1

check if cookie exists php

if (!isset($_COOKIE["lg"])) {
	setcookie("lg", "ro");
}
Posted by: Guest on July-30-2020
2

cookie are not set in php

setcookie('username',$username,time()+60*60*24*365);
// 'Force' the cookie to exists
$_COOKIE['username'] = $username;
Posted by: Guest on May-15-2020

Browse Popular Code Answers by Language