If there are no visible characters (whitespace or anything else) before the opening
<?php tag, then it is very likely that your file was saved with a
byte order mark (BOM). Your editor
should offer the option to save without one (as UTF-8 or plain ASCII/ANSI text), but that (unfortunately) is not usually the default these days. Any character appearing outside of the
<?php ... ?> tags is output, so the BOM, even though it's unprintable, still sends headers and starts output so it's too late to add the session.