php sessions not being detected
<p>I have a login page that I register two sessions username and password.  then redirect to another page.  Once at this page </p>

<pre><code>$_SESSION['username'] = "";
$_SESSION['password'] = "";
</code></pre>

<p>after login check I have the next page check if the session is registered</p>

<pre><code>session_start();

if(isset($_SESSION["username"]){


continue

}else go back to login page
</code></pre>

<p>Once I'm logged in I want to go to another page that depending on if the session variable is set I display something different on the page.</p>

<p>So on the galery page I do</p>

<p>at the very top of page I do</p>

<pre><code>&lt;?php 
session_start();

?&gt;
</code></pre>

<p>then further down where I want the button to be I do</p>

<pre><code>&lt;?php
if (isset($_SESSION['username'])){


show a new button

}

?&gt;
</code></pre>

<p>I get the button to show but at the top of the page I have</p>

<pre><code>Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent
</code></pre>

<p>and it messes up how my page is displayed.  Any ideas?  I have the session_start(); at the very begging of page I don't know why this is happening.  Any ideas?</p>

<p><img src="http://i.stack.imgur.com/s0ZWV.png" alt="where my session_start() is located"></p>
