I work in an application with CodeIgniter and I have the problem that when I reload the page or call another controller I lose the values of the session variables.
I think so:
$nuevoUsuario = array(
'usuario' => $this->input->post('usuario'),
'contrasena' => $this->input->post('contrasena')
);
// almacenar en sesion el usuario y la contraseña
$this->session->set_userdata($nuevoUsuario);
In the first re-address I am loaded with the data well. I show them with:
<?php print_r($this->session->userdata()) ?>
And I get:
Well, the problem is as I already commented, when I charge or call another controller that I lose that data, getting this:
As you can see, I lose the data and I change the ci_last_regenerate.
My CodeIgniter configuration is:
My php configuration in relation to the sessions is:
As seen, I put the:
$config['sess_cookie_name'] = 'PHPSESSID';
Same as the configuration returned by phpinfo () and still does not work. The thing is that the local works perfectly.
I have looked at documentation and tried a thousand ways that I see on the Internet and I can not find solutions. Has anyone happened to you?
Greetings.