Cookies are bits of data that a web browser stores on your visitor's computer. They can be very useful if you need to store things like your visitor's preferences or login data or other things that are specific to a particular visitor. The following example of how to set cookies.
<?php $date = time() + 60 ; setcookie( "login", "john", $date ); ?>
<?php $date = time() - 60 ; setcookie( "login", "john", $date, "/", "example.com" ); ?>