In PHP I set a cookie using
setcookie($name, null, -1, '/');
However I get the following warning
Warning: Cannot modify header information - headers already sent by (output started at php://input:1)
which is even more strange, because I have ob_start()
at the beginning of my PHP script.
I also set auto_prepend_file=NULL
in my php.ini
as described in Where could PHP output which started at php://input:1 be originating from?.
I use php-fpm 8.3 inside a Docker container, which is proxied by nginx.
As I understand it, php://input is a read only input stream, so where could the output be comming from?
Edit:
display_errors and error_reporting is off. php://input
contains the data from the post request
csrf-token=abc&user=def+&password=ghi&stayloggedin=on
It also seems that the php://input
is sent to the browser. Before the error occurs the content of php://input
is displayed on a blank page in the browser, the user is then redirected. Does anyone have any idea on where to start searching?
14