diff --git a/interface/web/login/logout.php b/interface/web/login/logout.php
index 57b76a36710889612fac993861dc130ec71d2b6e..53dc933022c59bbf2b9677b96e26771f41e15896 100644
--- a/interface/web/login/logout.php
+++ b/interface/web/login/logout.php
@@ -64,7 +64,6 @@ $app->plugin->raiseEvent('logout',true);
 $_SESSION["s"]["user"] = null;
 $_SESSION["s"]["module"] = null;
 $_SESSION['s_old'] = null;
-session_write_close();
 
 //header("Location: ../index.php?phpsessid=".$_SESSION["s"]["id"]);
 
@@ -77,5 +76,8 @@ if($_SESSION["s"]["site"]["logout"] != '') {
 		echo('URL_REDIRECT:index.php');
 	}
 }
-exit;
-?>
\ No newline at end of file
+// Destroy the session completely now
+$_SESSION = array();
+session_destroy();
+session_write_close();
+?>