note 106509 modified in function.session-start by danbrown

From: Date: Tue, 15 Nov 2011 16:17:46 +0000
Subject: note 106509 modified in function.session-start by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-184466@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: " <?php session_start(); ?>" Do you see the problem with my code? I finally did: " <?php" ^^------ There is an accidental space! I'm sure I'm not the only one who encounters this problem. Hopefully this helps others! --was-- 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! http://php.net/manual/en/function.session-start.php

« previous php.notes (#184466) next »