If you use Windows Notepad to edit PHP file and save it as Unicode,
then you may have probability to encounter PHP errors –
“Cannot send session cookie – headers already sent by …”

If you use Notepad to edit PHP and save as Unicode


Then, if you use some Hex editor (e.g. HHD Hex editor) to open it


You will find the first 3 bytes are non PHP code, those 3 bytes probably for Unicode recognition.

You may use Hex editor to delete the 3 bytes, then upload to the server, and test again.


The Apache web server should not generate the above message anymore.

As we know, some other text editor in Windows also generate the first 3 bytes character. However, if you use Dreamweaver (version 8 or above) and save in utf8, it works fine.

Thank you.

Pin It on Pinterest

Share This