title: PHP IF to display HTML based on session isset
body: <p>I have the below code, which gives no errors, but it only ever displays the Logout button, I don't really have much else to say. </p>
  
  <pre><code>&lt;?php
      if(isset($_SESSION)):?&gt;
              &lt;a href="endsession.php"&gt;&lt;div class= "buttons feature"&gt;Logout&lt;/div&gt;&lt;/a&gt;
      &lt;?php    
      else:?&gt;
          &lt;a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'"&gt;&lt;div class= "buttons feature"&gt;LOGIN&lt;/div&gt;&lt;/a&gt;
  
      &lt;?php endif; 
  ?&gt;
  </code></pre>
  
  <p>The Logout button runs:</p>
  
  <pre><code>&lt;?php
  session_start();
  session_destroy();
  ?&gt;
  </code></pre>
  
  <p>And have I have code in my main page which displays values stored in the session based on if the session isset, so I know it is destroying the session, and when I'm logged in it is set. </p>
  
  <p>I just don't understand why it always only displays the html from the if where the session doesn't exist. </p>
  
  <p>I've probably made a silly mistake, so sorry if I have.</p>
  
  <p>All help appreciated -Tom</p>