title: Sessions in Yii
body: <p>Here I go what am doing is I am using </p>
  
  <pre><code> Yii::app()-&gt;SESSION['userid']
  </code></pre>
  
  <p>with no </p>
  
  <pre><code>  Yii::app()-&gt;session-&gt;open();
  </code></pre>
  
  <p>at login</p>
  
  <pre><code>  Yii::app()-&gt;session-&gt;destroy();
  </code></pre>
  
  <p>at logout</p>
  
  <p>I wanna know if dont do the open and destroy session is it worthy . Does Yii do it internally.</p>
  
  <p>One more strange thing I dont know whats happening. In the same browser for a session I can login for multiple users .. this should not happen so.Is it that i am not using the open and destroy session methods .</p>
  
  <pre><code> public function actionLogout()
  {
      Yii::app()-&gt;user-&gt;logout();
      Yii::app()-&gt;session-&gt;clear();
      $this-&gt;redirect(Yii::app()-&gt;controller-&gt;module-&gt;returnLogoutUrl);
  }
  </code></pre>
  
  <p>Please let me know how do i figure this out </p>