$(window).unload(function() {
$.ajax({
type: "POST",
url: "ajax.php",
data: {
"logout": 1
}
});
});
Index.php - En üst satıra ekleyin !
session_start();
if(!isset($_SESSION['uye_no'])) header('Location: login.php');
ajax.php
if($_POST['logout'] == 1){
session_unset();
session_destroy();
}
?>