diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index 241b705787a33d9c559092a54dfa69efc01628e0..2690be79264e11357c72f3000d804595864dfd19 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -194,7 +194,7 @@ class SimpleSAML_Session
         }
 
         // check if we have stored a session stored with the session handler
-        $prev = (self::$instance !== null);
+        $session = null;
         try {
             $session = self::getSession();
 
@@ -223,7 +223,7 @@ class SimpleSAML_Session
          * error message). This means we don't need to create a new session again, we can use the one that's loaded now
          * instead.
          */
-        if (self::$instance !== null && !$prev) {
+        if (self::$instance !== null) {
             return self::$instance;
         }