php session_start(); $_SESSION['test']=5; $cookiename = "firsttimer"; $cookieval = "RCBVisit01"; $cookieval1 = "preload"; setcookie($cookiename, $cookieval1, time() + (86400*30), "/home/captive1/public_html/tmp/"); if(!isset($_COOKIE[$cookiename])=="RCBVisit01"){ // if cookie ain't set, show link echo "You are the first time here"; include ('/home/captive1/public_html/modal.php'); $_COOKIE[$cookiename]="RCBVisit01"; setcookie($cookiename, "RCBVisit01", time() + (86400*30), "/"); $_COOKIE[$cookiename]="RCBVisit01"; echo htmlspecialchars($_COOKIE[$cookiename]); }else{ // not firsttimer echo "Welcome back!"; } ?>