Tag Archives: headers

Cannot modify header information

I have been working on making a login page as part of learning php. This method also included using cookies, not everyones favorite but I had to learn about it. The thing with cookies is that they must be sent from the server to the client prior to any other information.

This was the area that was creating my problem, every time I logged in I would get this error.

Cannot modify header information – headers already sent by (output started at /var/mysqli_connect.php:18)

This is a common error when creating cookies. So pay attention to the error message, which is something I did not do straight away. All I had to do was delete any white space after my closing ?> in mysql_connect file.