diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php
index a2302802649a5a1fc3dff86e439162ed417910d5..72553fa0ee000fecc8ac470f864f9e74020fd59f 100644
--- a/apps/files_trashbin/ajax/delete.php
+++ b/apps/files_trashbin/ajax/delete.php
@@ -2,6 +2,8 @@
 
 OCP\JSON::checkLoggedIn();
 OCP\JSON::callCheck();
+\OC::$server->getSession()->close();
+
 $folder = isset($_POST['dir']) ? $_POST['dir'] : '/';
 
 // "empty trash" command
diff --git a/apps/files_trashbin/ajax/isEmpty.php b/apps/files_trashbin/ajax/isEmpty.php
index 2e54c7e77b989ec2c518201b76eea845d0930763..897ee26289507002e383fcc8e072aa4a4a3a43e4 100644
--- a/apps/files_trashbin/ajax/isEmpty.php
+++ b/apps/files_trashbin/ajax/isEmpty.php
@@ -6,6 +6,7 @@
 
 OCP\JSON::checkLoggedIn();
 OCP\JSON::callCheck();
+\OC::$server->getSession()->close();
 
 $trashStatus = OCA\Files_Trashbin\Trashbin::isEmpty(OCP\User::getUser());
 
diff --git a/apps/files_trashbin/ajax/list.php b/apps/files_trashbin/ajax/list.php
index 6cad101d34adea35972a91da6024fd6698a22cfb..e25301a26cba800f4250165467c9b371b1402feb 100644
--- a/apps/files_trashbin/ajax/list.php
+++ b/apps/files_trashbin/ajax/list.php
@@ -1,6 +1,7 @@
 <?php
 
 OCP\JSON::checkLoggedIn();
+\OC::$server->getSession()->close();
 
 // Load the files
 $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
diff --git a/apps/files_trashbin/ajax/preview.php b/apps/files_trashbin/ajax/preview.php
index 32905b2a71ce41d54df8bf72d456ef80cf8d1e58..1401e3b7a7df38bf559ff62eb0f6cc7c0bea8a7f 100644
--- a/apps/files_trashbin/ajax/preview.php
+++ b/apps/files_trashbin/ajax/preview.php
@@ -6,6 +6,7 @@
  * See the COPYING-README file.
  */
 \OC_Util::checkLoggedIn();
+\OC::$server->getSession()->close();
 
 if(!\OC_App::isEnabled('files_trashbin')){
 	exit;
diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php
index 02d651925cac747d5f645370677f84d1f8308dc5..ab7d57f5a7f9c739decf7126e67a074cb692b99d 100644
--- a/apps/files_trashbin/ajax/undelete.php
+++ b/apps/files_trashbin/ajax/undelete.php
@@ -2,6 +2,7 @@
 
 OCP\JSON::checkLoggedIn();
 OCP\JSON::callCheck();
+\OC::$server->getSession()->close();
 
 $files = $_POST['files'];
 $dir = '/';