Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

PHP $_COOKIE explained

22.4K views on YouTube

#PHP #course #tutorial

// cookie = Information about a user stored in a user’s web-browser
// targeted advertisements, browsing preferences, and
// other non-sensitive data

setcookie(“fav_food”, “pizza”, time() + (86400 * 2), “/”);
setcookie(“fav_drink”, “coffee”, time() + (86400 * 3), “/”);
setcookie(“fav_dessert”, “ice cream”, time() + (86400 * 4), “/”);

if(isset($_COOKIE[“fav_food”])){
echo”BUY SOME {$_COOKIE[“fav_food”]} !!!”;
}
else{
echo”I don’t know your favorite food”;
}