Program:
Output:
<?php $cookie_name = "Name"; $cookie_value = "Atharva"; 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: