codeigniter user log out api to destroy the session of loged in user


Example

/***************************
log out user
***************************/
public function logout(){
  //delete all session
  session_destroy();
  $this->output->set_output(json_encode(array('status'=>true,'msg'=>'log Out successfully')));
}

enter image description here