Cannot send session cookie - headers already sent
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8028957/headers-already-sent-by-php">Headers already sent by PHP</a>  </p>
</blockquote>



<p>The following code in PHP gives the warning.</p>

<pre><code>&lt;?php
    if(!isset($_SESSION))
    {
        session_start();  // line 4
    }

    if(!isset($_SESSION['valid_admin']))
    {
        header("location:Login.php");  //line 9
    }
?&gt;
</code></pre>

<hr>

<pre><code>Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\wamp\www\wagafashion\Order.php:8) in C:\wamp\www\wagafashion\Lock.php on line 4

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\wamp\www\wagafashion\Order.php:8) in C:\wamp\www\wagafashion\Lock.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\wagafashion\Order.php:8) in C:\wamp\www\wagafashion\Lock.php on line 9
</code></pre>

<p>I searched on <a href="http://www.google.co.in/#q=Warning%3a+session_start%28%29+%5Bfunction.session-start%5D%3a+Cannot+send+session+cookie+-+headers+already+sent+by&amp;hl=en&amp;biw=1366&amp;bih=629&amp;fp=1&amp;bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&amp;cad=b" rel="nofollow">Google</a> and found a question <a href="http://stackoverflow.com/questions/5757984/warning-session-start-function-session-start-cannot-send-session-cookie">here</a> but I by far don't understand what is mentioned there. How could I solve it?</p>

<p>[My application with the above code was working fine but a few days ago the system crashed with the <em>blue screen error</em> and I had to reinstall it where I installed a different version of WAMP. Is this the problem?]</p>
