Seguendo l'esempio riportato negli articoli
http://javascript.html.it/articoli/l...ura-di-pagina/
nella mia pagina principale ho messo nel tag body:
<body onUnload="window.open('logoutctr.php','chk','top=2 000');this.focus();">
logoutctr.php
<html>
<head>
<script type="text/javascript">
<!-- // (c) br1 - 2002
if (opener.closed) {
location.href="logout.php";
window.close();
} else {
top.close();
}
//-->
</script>
</head>
</html>
logout.php
<?php
session_start();
session_destroy();
header("Location: http://www.example.com/");
?>
Però non funziona. la sessione non viene distrutta. Perchè ?