$cookie_name = "sendsmsalert2";
$cookie_value = "send done";
setcookie($cookie_name, $cookie_value, time() + (86400), "/");
function get() {
$cookie_name = "sendsmsalert";
if (!isset($_COOKIE[$cookie_name])) {
echo "Cookie named "" . $cookie_name . "" is not set!";
} else {
echo "Cookie "" . $cookie_name . "" is set!
";
echo "Value is: " . $_COOKIE[$cookie_name];
}
}
Answer (1)
$cookie_name = "UserDetails";
$cookie_value = json_encode($sessionData);
setcookie($cookie_name, $cookie_value, time() + (86400) * (30 * 365), "/");