title: destroy particular session Among two sessions in codeigniter
body: <p>I have maintained two sessions with different variable set to true at the time of login in my application in codeigniter. The first session is for the admin and the second is for normal users. Now what i want is when admin logs in then i have to destroy all sessions of normal user and fetch admin data.
  My code is as :
  for admin login
  $query = $this->dbmodel->validate(); //to validate admin//
              if ($query) {</p>
  
  <pre><code>            // if the user's credentials validated...
  
              $data = array(
                  'username' =&gt; $this-&gt;input-&gt;post('username'),
                  'admin_logged_in' =&gt; true
  
  
              );
  
              $this-&gt;session-&gt;set_userdata($data);
  </code></pre>
  
  <p>for normal user</p>
  
  <pre><code>                $data = array(
                  'useremail' =&gt; $email,
                  'username' =&gt; $name,
                  'logged_in' =&gt; true);
  
              $this-&gt;session-&gt;set_userdata($data);
  </code></pre>
  
  <p>Thanks in advance</p>