headers->setCookie(new Cookie('foo', 'bar', 253402310800, '', null, false, false)); $r->sendHeaders(); setcookie('foo2', 'bar', 253402310800, '/');