diff --git a/admin/cron.php b/admin/cron.php
index <HASH>..<HASH> 100644
--- a/admin/cron.php
+++ b/admin/cron.php
@@ -18,6 +18,10 @@
     require_once("../config.php");
 
     if (!$alreadyadmin = isadmin()) {
+        unset($_SESSION['USER']);
+        unset($USER);
+        unset($_SESSION['SESSION']);
+        unset($SESSION);
         $USER = get_admin();      /// Temporarily, to provide environment for this script
     }
 
@@ -135,11 +139,6 @@
 
     echo "Cron script completed correctly\n";
 
-    if (!$alreadyadmin) {
-        $SESSION = NULL;
-        $USER = NULL;
-    }
-
     $difftime = microtime_diff($starttime, microtime());
     echo "Execution took ".$difftime." seconds\n";
Even safer implementation of the temporary $USER variable