<?php header('Content-Type: text/html; charset=utf-8'); //Set Cookie, valid for one hour setcookie('website','onestopweb.iteye.com',time()+3600); // Determine if the cookie exists if(isset($_COOKIE['website'])){ // output the cookie echo 'The cookie exists: '.$_COOKIE['website'].'<br>'; }else{ echo 'The cookie does not exist'.'<br>'; } //Delete the cookie, set the expiration time to the past one hour //setcookie('website','',time()-3600);
Effect picture: