PHP issue “Cannot send session cookie” – Stack Overflow

Have you checked for Byte Order Mark (BOM) ? It happens when your file is in UTF8 and you open it with Windows’ Notepad.exe. – Geoffroy Mar 12 ’13 at 16:47
  • How do i check for BOM? If this is causing the issue how do i get rid of it? – Kaya Suleyman Mar 12 ’13 at 16:50
  • Use an editor which is able to show you special chars. – Geoffroy Mar 12 ’13 at 16:51
  • What editor are you using? – Alexander M. Turek Mar 12 ’13 at 16:52
  • Microsoft Expression. I’m new to this stuff, how do i check for BOM, what does it look like and how do i get my code working again? – Kaya Suleyman Mar 12 ’13 at 16:54
    • Download Notepad++ and open the file there, delete all fancy characters before the <?PHP
    • Make sure there is no whitespace character like ” ” or tab or linebreak before the <?PHP.
      • In Notepad++ click Encoding and then UTF-8 without BOM to convert the file to UTF-8 without BOM, then save it.
    • Also add ob_start(); before session_start(); to be safe.

Source: PHP issue “Cannot send session cookie” – Stack Overflow

PHP issue “Cannot send session cookie” – Stack Overflow was last modified: December 1st, 2020 by Jovan Stosic

Leave a Reply