Setting a Cookie Using the header() Function
<?php header("Set-Cookie: mycookie=myvalue; path=/; domain=.demo.org"); ?>