[thelist] Session cache limite and header information

kasimir-k evolt at kasimir-k.fi
Mon Apr 10 07:06:48 CDT 2006


Ken Schaefer scribeva in 10/04/2006 11:19:
> Agreed. What seems to be happening is that you've already sent some of the
> HTTP Body (i.e. stuff after the headers have been sent). This could be
> whitespace of some kind. I think the error is telling you that you can't send
> any more HTTP headers because they've already been sent.

Exactly, and I might as well stop being too lazy :-) and post the 
relevant link: http://php.net/header
"Remember that header() must be called before any actual output is sent, 
either by normal HTML tags, blank lines in a file, or from PHP. It is a 
very common error to read code with include(), or require(), functions, 
or another file access function, and have spaces or empty lines that are 
output before header() is called."
and
"Note:  As of PHP 4, you can use output buffering to get around this 
problem, with the overhead of all of your output to the browser being 
buffered in the server until you send it."

And this applies to setting cookies too (e.g. setcookie or session_start 
when using cookie-based sessions), as cookies are sent to the client in 
the headers.

.k



More information about the thelist mailing list