Could you tell me how delete all the records from the following table when the user session expires or the user close the browser.
tablename: test
id sessions_id value
1 admin_1 12
2 admin_1 12
I know about Temporary table, but I don't want to use it... because I cannot fetch data after sometime I create the table.
Thanks :)
What I have tried:
function logout(){
//My query to delete the table
$this->session->sess_destroy();
redirect('login');
}
the above solution works fine but I was wondering what would happen if any user didn't logout..just simply closed the window.