1
I have two sites that perform user authentication and soon after create a session for the same, the two sites access the same database and therefore the user structure returned by the instruction:
$usuario = $this->db->get('usuarios').result();
has the same fields, the session is created like this:
$this->session->set_userdata(array('logged' => true, 'usuario' => $usuario[0]));
all pages of the two sites redirect the user to the login screen if the field logged
is not set as true
in the session, the sites work normally (I can even open several tabs for the same site), however, if I authenticate on one of them and try to access any page of the other, the created sessions are destroyed (on both sites if they exist). I’m using:
codeigniter 2.2.1, PHP/5.4.19, Apache/2.4.4
.
I really have no idea why that.
This is probably a Codeigniter standard, when it detects two equal sessions on the same client and domain it closes the session. You could just change the name of those variables that I think would work.
– Leonardo