title: Access information from session in website with two different sessions
body: <p>My website has two restrict areas, in the public website and admin area. I've tried to follow some instructions to make multiple sessions throughout the website, but I'm facing some problems about accessing and retrieving their information.</p>
  
  <p>Below are the <code>login</code> methods from both pages. First from the administration area:</p>
  
  <pre><code>public function login()
  {
      if ($this-&gt;Admin_model-&gt;find_credentials()) {
          $data['user_email'] = $this-&gt;input-&gt;post('email');
          $this-&gt;session-&gt;set_userdata('auto', $data);
  
          redirect('/admin/dashboard', 'refresh');
      } else {
          $this-&gt;session-&gt;set_flashdata('message', 'Desculpe, credenciais inválidas');
          redirect('/admin/entrar');
      }
  }
  </code></pre>
  
  <p>And then, the admin area in the public website:</p>
  
  <pre><code>public function login()
  {
      if ($this-&gt;Usuarios_model-&gt;find_credentials()) {
          $email = $this-&gt;input-&gt;post('email');
  
          if ($this-&gt;Usuarios_model-&gt;is_active($email)) {
              $data = array();
              $data['nome'] = $this-&gt;Usuarios_model-&gt;find_col_by_email('nome_razao_social', $email);
              $data['email'] = $email;
              $data['tipo_usuario'] = $this-&gt;Usuarios_model-&gt;find_col_by_email('tipo_usuario', $email);
              $data['id_usuario'] = $this-&gt;Usuarios_model-&gt;find_col_by_email('id', $email);
  
              $this-&gt;session-&gt;set_userdata('auto', $data);
              $this-&gt;session-&gt;set_flashdata('message', 'Bem-vindo!');
  
              redirect('/usuario/painel');
          } else {
              $this-&gt;session-&gt;set_flashdata('message', 'Por favor, ative o seu cadastro');
              redirect('/');
          }
      } else {
          $this-&gt;session-&gt;set_flashdata('message', 'Desculpe, credenciais inválidas');
          redirect('/');
      }
  }
  </code></pre>
  
  <p>For each new session, I am settling a name for it. Now, every point I call the session value, I must specify the name of which session I want, but I am having an error message after I try to log-in:</p>
  
  <blockquote>
    <p>Message: Array to string conversion</p>
  </blockquote>
  
  <p>This error points at line 161 of my model, which has the following code:</p>
  
  <pre><code>public function find_details($email = null, $id = null, $id_carro = null)
  {
      $this-&gt;db
          -&gt;select(
              'usuario.*,' .
              'estado.nome_estado AS uf,' . 
              'cidade.nome_cidade AS cidade'
          )
          -&gt;join('cidade', 'cidade.id = usuario.id_cidade')
          -&gt;join('estado', 'estado.id = usuario.id_estado');
  
      if ($email) {$this-&gt;db-&gt;where('usuario.email', $email);} // 161
      ...
  }
  </code></pre>
  
  <p>What do I need to do to make multiple sessions work correctly?</p>