I made a function to log off the system, however, when I use the sess_destroy()
function to destroy the session, it does not allow the set_flashdata()
to be displayed. When I remove the function sess_destroy()
the set_flashdata()
works normally. Can anyone give me a hint of what it can be?
Controller:
public function logoff(){
$this->session->unset_userdata(array('user_id' => '', 'user_nome' => '', 'user_admin' => '', 'user_logado' => ''));
$this->session->sess_destroy();
set_msg('logoffok', 'Logoff efetuado com sucesso!', 'sucesso');
redirect('funcionario/login');
}