// This goes before the <html> tag
// time() + 3600 is the expiration. time()+3600 would be 1 hour ( 3600 seconds )
That would set a cookie to the users computer, that would last the set time. To display the contents of the cookie, you need to use $HTTP_COOKIE_VARS ( or $_COOKIE )
// an example, set a cookie then get its value
// sets a cookie called name, with a value of matt that lasts 5 minutes.
// would write matt on to the page.