note 106509 added to function.session-start
| From: | james at ustelcom dot net | Date: | Tue, 15 Nov 2011 10:52:24 +0000 |
| Subject: | note 106509 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184448@lists.php.net to get a copy of this message | ||
I had the infamous "Warning: session_start() [function.session-start]: Cannot send session
cache limiter - headers already sent ..." error, and I was convinced it was because I was
trying to open a session AND send a cookie. I tried everything that was suggested, uploaded in
ANSI, uploaded in UTF 8, etc. I tried opening the session first, then sending the cookie first.
Turns out my problem was quite simple:
" <?
session_start();
?>"
Do you see the problem with my code? I finally did:
" <?"
^^------ There is an accidental space!
I'm sure I'm not the only one who encounters this problem. Hopefully this helps others!
----
Server IP: 69.147.83.197
Probable Submitter: 173.187.237.86
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- https://master.php.net/note/edit/106509
Del: integrated -- https://master.php.net/note/delete/106509/integrated
Del: useless -- https://master.php.net/note/delete/106509/useless
Del: bad code -- https://master.php.net/note/delete/106509/bad+code
Del: spam -- https://master.php.net/note/delete/106509/spam
Del: non-english -- https://master.php.net/note/delete/106509/non-english
Del: in docs -- https://master.php.net/note/delete/106509/in+docs
Del: other reasons-- https://master.php.net/note/delete/106509
Reject -- https://master.php.net/note/reject/106509
Search -- https://master.php.net/manage/user-notes.php