title: echo $_SESSION then unset
body: <p>I know this is an amateurish question but I need to echo a session variable then destroy the variable.</p>
  
  <p>I've tried this:</p>
  
  <pre><code>if(isset($_SESSION['m'])){
     echo($_SESSION['m']);
     unset($_SESSION['m']);
  }
  </code></pre>
  
  <p>I've also tried session_destroy();</p>
  
  <p>and i've tried to unset/destroy the session at the end of the page (after closing HTML tag)</p>
  
  <p>The problem i'm having is the session is being destroyed before it is echoed. I've use the code above before without any problems. Is there anyway to do what I need to do, or do I have to find a different solution?</p>
  
  <p>Thanks in advance :)</p>