How can we declare cookie in PHP and then how can we expire it ?

setcookie() function is using to set cookies in php
To declare Cookies syntax will be:- setcookie(name, value, expire, path, domain);
name : Name of the cookie
value : Value of the cookie
expire : The time for cookie to expire
path : path to save the cookie where we want to save the cookie information
domain : domain name on which we want to save the cookie
eg : setcookie(“username”,”kiran”,time()+60*60*60*24);
In the above example the cookie name is username having value “kiran” and set for one day
To expire cookies we have set the time of cookie in past
To expire Cookies syntax will be: setcookie(name,value,time-3600);