Bake Your First PHP Cookie
Cookies are small pieces of information that are stored in your web browser. They typically contain data that is used to identify you when you look at a website so that site can be customized for each visitor.
The following script will set a cookie with the value of an email addess. It will also have an expire date / time.
The "echo" part of the script simply displays the cookie which we have set.
setcookie("email", "firstname.lastname@example.org", time() + 3600);
Please let me know if this script was helpful to you.