<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Logout extends CI_Controller {
	function index(){
		$this->doLogout();
	}
	function doLogout(){
		$this->load->model('Login/validation_user');
		$this->validation_user->delSession();
		$this->session->sess_destroy();
		$this->nativesession->freeSession();
		$this->session->set_userdata('namaPN','');
		session_start();
	    session_unset();
	    session_destroy();
	    session_write_close();
	    setcookie(session_name(),'',0,'/');
	    session_regenerate_id(true);
		redirect('login');
	}

	function clear_cache(){
        $this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0");
        $this->output->set_header("Pragma: no-cache");
    }

}

?>