title: Why Session object destruction failed
body: <p>I get "Session object destruction failed" when I use session_destroy().</p>
  
  <pre><code>session_start();
  if(isset($_SESSION['user_id'])){    
      $_SESSION=array();
      if(isset($_COOKIE[session_name()])){
          setcookie(session_name(),'',0,"/");
      }
      session_destroy();
  }
  </code></pre>
  
  <p>What causes this error?</p>