title: Why is PHP session_destroy() not working?
body: <p>I tried to destroy all session variable by using the <code>session_destroy()</code> method, but after using this method, the values are not destroyed.</p>
  
  <p>Why is <code>session_destroy()</code> not working?</p>
  
  <p>Is there any other way to destroy the session in PHP?</p>
  
  <pre><code>if (isset($_SESSION['LAST_ACTIVITY']) &amp;&amp; (time() - $_SESSION['LAST_ACTIVITY'] &gt; 1800)) 
  {   
      session_destroy();   
      session_unset();     
  }
  </code></pre>