Monday, December 14, 2009

Warning session_start(): Cannot send session cookie

Warning messages at top of the page. how can i fix it?
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at e:\apache\www\drupal\includes\ in e:\apache\www\drupal\includes\ on line 760

I have solved the probleme. On saving files (like : *.inc, *php ...) do not add a unicode signature (BOM)! Also open the files you have edited and save again uncheck the checkbox "Add Unicode Signature (BOM)". I use Emeditor.

This is a common PHP error and isn't particularly specific to Drupal. In 99.99% of cases, this error indicates that there are empty spaces and/or blank lines at the beginning of one of your files. Since settings.php is the one that people normally edit, it's the most likely place to look. If you've opened up and/or edited any of the other files, you should check them out as well.

The comment about BOM has to do with Unicode translation and encoding of text files. If that's all nonsensical-techno-gobbeldy-gook to you, perhaps the simplest way to make sure you're not having that same problem is to open your settings.php file in the simplest text editor you can find (something like notepad if you are using Windows). I believe that will strip out any other hidden initial characters that may have been inserted into the beginning of the file -- although I have to confess I haven't tested that.

No comments: