title: Check if session logged is true
body: <p>I have: header.php, register.php, login.php and profile.php</p>
  
  <p>When the user is login in, I redirect him on profile.php using header(Location:profile.php)</p>
  
  <p>Also, before I do that redirect I set a session:</p>
  
  <pre><code>$_SESSION['logged']= $user_email;
  </code></pre>
  
  <p>Using that, I would like to do a small trick on header.php, something like:</p>
  
  <pre><code>    if(($_SESSION['logged'] == true) {
           echo "&lt;a href="profile.php"&gt; Logo &lt;/a&gt;"; 
      } 
      else {
           echo "&lt;a href="index.php"&gt; Logo &lt;/a&gt;";
     }
  </code></pre>
  
  <p>Somehow, this isn't working. I'm missing something?</p>