diff --git a/include/app_class.php b/include/app_class.php
index <HASH>..<HASH> 100644
--- a/include/app_class.php
+++ b/include/app_class.php
@@ -97,6 +97,8 @@ class App {
         $output["content"] = $this->HandleException($e);
       }
       
+      $this->session->quit();
+
       $contegargs = any($this->cfg->servers["conteg"], array());
       if (is_array($this->cfg->servers["conteg"]["policy"][$output["responsetype"]]))
         $contegargs = array_merge($contegargs, $this->cfg->servers["conteg"]["policy"][$output["responsetype"]]);
diff --git a/include/sessionmanager_class.php b/include/sessionmanager_class.php
index <HASH>..<HASH> 100644
--- a/include/sessionmanager_class.php
+++ b/include/sessionmanager_class.php
@@ -324,6 +324,9 @@ class SessionManager
 
     //Profiler::StopTimer("SessionManager::Init()");
   }
+  public function quit() {
+    session_write_close();
+  }
 
   /**
    * Create a new persist record in the userdata.usersssion table
- Shutdown session before calling Conteg