Starting a page with setcookie()
<?php
setcookie('userid','AAA');
?>
<html><head><title>Page with cookies</title><head>
<body>
This page sets a cookie properly, because the PHP block
with setcookie() in it comes before all of the HTML.
</body></html>
Related examples in the same category