[eluser]joe_h[/eluser]
Hi guys, I have doubts CI sessions. The issue is I want to do an authentication system with CI but I happen the following:
From a form in ExtJS I call the login controller function
Code:
url : BASE_PATH+'index.php/login/validar',
The method is this: Verify that the user is in the database
Code:
public function validar()
{
if($this->usuario_model->verificar($this->input->post('user'), $this->input->post('pass'))){
$this->json->GenerarRespJSON();
}else{
$this->json->setReason('Usuario o contraseña incorrecto');
$this->json->GenerarMensajeJSONText();
}
}
If is TRUE I call the method to start the application that contain the logout
Code:
BASE_PATH+'index.php/login/iniciar/'+user
the start method is defined as follows:
Code:
public function iniciar($user)
{
$newdata = array(
'username' => '$user',
'logged_in' => TRUE
);
$this->session->set_userdata($newdata);
$this->load->view('evento');
........ more call views.......
$this->load->view('index_aplication');
}
The logout calls this method:
Code:
public function cerrar()
{
$this->session->sess_destroy();
$this->load->view('inicio');
}
This generates a row in the database that inserts well
"3b60ba810e126ef97b5bc7f76aae5759";"127.0.0.1";"Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20100101 Firefox/11.0";1334602031;"a:3:{s:9:"user_data";s:0:"";s:8:"username";s:5:"$user";s:9:"logged_in";b:1;}"
Then close the application
But when we press the back button of the browser displays the application
What happen??
Please help me!