setcookie('userid','AAA');?>Page with cookiesThis page sets a cookie properly, because the PHP blockwith setcookie() in it comes before all of the HTML.