diff --git a/hybridauth.pages.inc b/hybridauth.pages.inc
index f3b03c2..f23a529 100644
--- a/hybridauth.pages.inc
+++ b/hybridauth.pages.inc
@@ -155,7 +155,19 @@ function _hybridauth_window_auth($hybridauth, $provider_id) {
     // Destroy the session started in hybridauth_window_start() if user is not
     // logged in.
     if (!user_is_logged_in()) {
-      session_destroy();
+      $delete_session = TRUE;
+      // Delete session only if it doesn't contain data from other modules.
+      foreach ($_SESSION as $key => $value) {
+        if ('HA::' == substr($key, 0, 4)) {
+          unset($_SESSION[$key]);
+        }
+        else {
+          $delete_session = FALSE;
+        }
+      }
+      if ($delete_session) {
+        session_destroy();
+      }
     }
     switch ($error_code) {
       case 5:
