Posted by Jonathan on 01/18/06 22:54
Tomasz Nowak wrote:
> 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
>
>
This is a very common error with sessions. You have sent data back to
the user before starting the session. The session_start command should
appear in your code before you return any data (even echoing a single
charachter).
If you have already sent data before starting the session the browser
has already received a header. This header contains among a few things
the content type of the document that the user has requested.
Probably the first data is echoed at line 8, as can be read in the error
message, while your session is started at line 11. Try to adapt the code
so the session_start occurs before line 8, this should solve the problem.
Jonathan
Navigation:
[Reply to this message]
|