<?php
$cookie_name = "user"; //cookie name
$cookie_value = "php"; //cookie value
setcookie($cookie_name,$cookie_value,time() + (5) ); // time will be set in seconds // setting cookie using setcookie() function
if(isset($_COOKIE[$cookie_name])) // check cookie set or not
{
echo "Cookie is set";
echo $_COOKIE[$cookie_name]; // fetching cookie value
}
else
{
echo "Cookie Deny";
}
?>
Choose the right course and start building your future with practical skills.
Learn HTML, CSS, JavaScript, and PHP to build modern, responsive websites and real-world projects.
Enroll Now See Full Details
Understand electronics basics with hands-on breadboard projects and circuit building techniques.
Enroll Now See Full Details
Step into AI with real-world applications, automation tools, and smart development techniques.
Enroll Now See Full Details