To modify cookie, just set(again) the cookie using the setcookie() function.
Program:
Output:
Program:
<?php $cookie_name = "Name"; $cookie_value = "Coding"; setcookie($cookie_name,$cookie_value,time()+(86400*30),"/"); // 86400 = 1Day if(!isset($_COOKIE[$cookie_name])) { echo "Cookie Named ".$cookie_name." is not set"; } else { echo "Cookie Name: ".$cookie_name." is set. <br/>"; echo "Cookie Value: ".$cookie_value; } ?>
Output: