I am working on a popup script which gets shown when the user leaves the page. The problem is, the user keep on getting shown that page whenever he leaves page Everytime which I dont' want. I just want the pop up to be shown to the first time visitor only. That's it. This can be easily done with PHP but I am just wondering what's the best way of doing it ? Is putting such cookie function on footer file a good idea, since it will called everytime when the page gets load, increasing the loadtime of the page ? Cheers
if (!isset($_COOKIE['popup'])) { setcookie('popup', 1, strtotime('+1 Day')); ?> pop up code here <?php } PHP: