469,631 Members | 980 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

Problem - sessions

Hello

I have a problem with sessions - how to resolve this:

"Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at c:\usr\krasnal\www\an\edycja.php:8) in
c:\usr\krasnal\www\an\edycja.php on line 11"

Thx for all

TomeN
Jan 18 '06 #1
3 1118
>I have a problem with sessions - how to resolve this:

"Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at c:\usr\krasnal\www\an\edycja.php:8) in
Take the stuff on line 8 that generates output, and move it *AFTER* line
11. Even a blank line outside <?php ?> is a problem.

c:\usr\krasnal\www\an\edycja.php on line 11"


Gordon L. Burditt
Jan 18 '06 #2
Tomasz Nowak wrote:
I have a problem with sessions - how to resolve this:

"Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at c:\usr\krasnal\www\an\edycja.php:8) in
c:\usr\krasnal\www\an\edycja.php on line 11"


This message means that when php reached line 11 and tried the
session_start() you have there, it was unable to do so because output
had already started (by something you wrote on line 8) and headers
(which are needed for session management) *have*to*be* sent before
anything else.

So, do one of the following:

a) delete line 8;
b) move line 11 to somewhere before line 8;
c) try to code your site without sessions;

--
If you're posting through Google read <http://cfaj.freeshell.org/google>
Jan 18 '06 #3
On 2006-01-18, Tomasz Nowak <no****@op.pl> wrote:
"Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at c:\usr\krasnal\www\an\edycja.php:8) in
c:\usr\krasnal\www\an\edycja.php on line 11"


It's one of the most frequent problems and a little websearch for "headers
already sent" will return more than enough good solutions.

a-) As the error message suggests, make sure there is no output before you call
session_start or header. Usually, this happens because there is some whitespace
before the <? where the php code starts.

b-) Use outputbuffering. http://www.php.net/ob. Notice that this does not buffer
headers.
--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>
Jan 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ben | last post: by
9 posts views Thread by Bartosz Wegrzyn | last post: by
1 post views Thread by Vince | last post: by
6 posts views Thread by Paul | last post: by
17 posts views Thread by jensen bredal | last post: by
1 post views Thread by fizbang | last post: by
4 posts views Thread by Ian Davies | last post: by
3 posts views Thread by stclaus | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.