I have a problem..in $config[\'sess_expire_on_close\'] = TRUE;
when i close the browser..the session still save in the database.
and i can still see the data
The server never knows about the user closing their browser. 'sess_expire_on_close' regards whether the user's cookie will be written and re-used when the browser is restarted.
To detect and end session, you'd have to perform a check like outlined in this question: javascript detect browser close tab/close browser
and then perform
$this->session->sess_destroy();
in codeigniter.