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

class MY_Session extends CI_Session {

public function __construct() {
    parent::__construct();
    $this->load->model('m_masters');
}

function sess_destroy() {

    //write your update here 
    $querystring = "update operators set login = '0' where operator = '".$this->session->userdata('username')."'";
    $this->m_masters->querying($querystring);

    //call the parent 
    parent::sess_destroy();
}

}