Friday, 7 August 2015

PREVENT BACK BUTTON AFTER LOGOUT USING CODIEGNTER

Hello i found my problem in my project and then solved, so i posted here hope someone will help from this post i found this easy tutorial here

 So i reblog in here First create this name it sukasukalo_helper.php and then put in your helper

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

then go to your config/autoload.php load it by autoload so you will not wasting time load many time


$autoload['helper'] = array('sukasukalo');

then put it in every function in your controller to prevent back after users log out

{ 
  //here calling the function in helper
  backButtonHandle();
  //to make your web secure put this check session, if session empty will throw to default controller
  if (($this->session->userdata('nama')=="")  and ($this->session->userdata('username')=="")) {
   redirect('welcome');
  }
  //it's just my simple project setting as you need i
  $name = $this->session->userdata('name');
  $data['name'] = $this->model_user->login($name)->row_array();
  $data['dataarticle'] = $this->model_article->all();
  $this->admin->load('template','admin-article',$data);
 }

If you feel this helpfull please share and if you any another way to make more secure and efisien just feel free to disccuss here Thanks for visitng me !

No comments:

Post a Comment