How to disable back button after logout in CodeIgniter 3?

In CodeIgniter when we perform a login and logout functionality. Often we got a problem that is once user click logout button or link and then we start to think that “How to disable back button after logout in CodeIgniter” System end the user’s session and redirect him to on a differ page. But if he click on the back button he can view the secure area again. To prevent this problem. I use this trick :-

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

// Code here is run before admin controllers
class Member extends Public_Controller {

public function logout(){







protected function clearCache(){
    $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT');
    $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
    $this->output->('Pragma: no-cache');
    $this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");