How to set cookie in php ?

setcookie(‘variable’,’value’,’time’);

variable – name of the cookie variable
value – value of the cookie variable
time – expiry time
Example: setcookie(‘Test’,$i,time()+3600);

Test – cookie variable name
$i – value of the variable ‘Test’
time()+3600 – denotes that the cookie will expire after an one hour