Hello! Where ob_flush() contents of the ob_flush() output buffer ob_flush() ? In the browser in this case?
If at the end of the code do not put ob_flush(); , the string is still output. Or php puts it yourself? ..
ob_start(); // включить буфер echo 'Test'; // это echo попадает в буфер (задерживается) setcookie("name", "John"); // установить (отправить) куки echo $_COOKIE['name']; // => John ob_flush(); // Сброс (отправка) буфера вывода