PHP Sessions Error

Posted by Andrei Korchagin on Stack Overflow See other posts from Stack Overflow or by Andrei Korchagin
Published on 2011-02-17T07:22:49Z Indexed on 2011/02/17 7:25 UTC
Read the original article Hit count: 191

Filed under:
|
|

I'm new to PHP sessions and I've come across the following error:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at somefile:someline).

As well as this one:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent by (output started at somefile:someline).

The session_start(); is the very first thing in all of my code. I'm not sure what the problem is. It gave me line numbers but all I do on those lines is start the session.

Also - I have a portion of code whose POST action is another PHP page. How can I set a $_SESSION variable pertaining to this page within that action page?

© Stack Overflow or respective owner

Related posts about php

Related posts about html