CodeIgniter Forums
session_destroy not working please help if possible. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: session_destroy not working please help if possible. (/showthread.php?tid=48795)



session_destroy not working please help if possible. - El Forum - 01-29-2012

[eluser]noname525[/eluser]
vv


session_destroy not working please help if possible. - El Forum - 01-29-2012

[eluser]InsiteFX[/eluser]
Code:
public function logout()
{
    $this->session->userdata = array();
    // or
    $data = array();
    $this->session->set_userdata($data);

    $this->session->sess_destroy();
    $url = base_url();
    redirect($url.'index.php/home', 'refresh');
}