title: How to properly kill sessions in zend framework?
body: <p>This is how I set sessions </p>
  
  <pre><code>$this -&gt; sess = new Zend_Session_Namespace('user');
  $this -&gt; sess -&gt; username = "Bob";
  $this -&gt; sess -&gt; admin = "1";
  </code></pre>
  
  <p>And this is how I kill it</p>
  
  <pre><code>setcookie("mycookiename",md5(rand(10,1200)),time() - (60 * 60),"/",".site.com");
  $_SESSION = array();
  session_destroy();
  $this -&gt; _redirect('/');
  </code></pre>
  
  <p>but it still keeps the $this->sess->admin as '1' ... username is gone but admin stays as one. What's the correct way to delete ALL sessions associated with the client? </p>
  
  <p>If I do</p>
  
  <pre><code>$this-&gt;sess-&gt;admin = 0;
  </code></pre>
  
  <p>Then it works, but I doubt this is the right way for each session variable that i hold.</p>
  
  <p>I also tried</p>
  
  <pre><code>setcookie("mycookiename",md5(rand(10,1200)),time() - (60 * 60),"/",".site.com");
  Zend_Session::namespaceUnset($this-&gt;sess);
  </code></pre>
  
  <p>and it didn't work, it didn't close any sessions.</p>