i have my lougout.php which destroys sessions and session ids on logout. I want to have same effect means i want to call this logout.php script when the user closes the "browser tab".
as these are the days of "browser tabs" so this is very important for me.
when the user closed the whole browser then all session and session ids are destroyed automatically but these sessions are not destroying when the user closes the "browser tab".
closing "browser tab".
this is my logout script
<? require_once("config.php"); $unique_id = session_id(); session_regenerate_id(); $qry="delete from cart_table where unique_id='$unique_id'"; mysql_query($qry); $_SESSION = array(); session_unset(); session_destroy(); header("Location:index.php"); ?>