]> git.wh0rd.org Git - tt-rss.git/commitdiff
only destroy unlogged sessions
authorAndrew Dolgov <fox@fakecake.org>
Wed, 3 Apr 2013 15:23:43 +0000 (19:23 +0400)
committerAndrew Dolgov <fox@fakecake.org>
Wed, 3 Apr 2013 15:23:43 +0000 (19:23 +0400)
include/functions.php

index 05f184eafe80d294e122be82d4754286a4ff781e..f4f6ed2095c1d83a65d8ac52c01869f491f4b52d 100644 (file)
                        cache_prefs($link);
                        load_user_plugins($link, $_SESSION["uid"]);
                } else {
-                       if (!$_SESSION["uid"] || !validate_session($link)) {
+                       if (!validate_session($link)) $_SESSION["uid"] = false;
+
+                       if (!$_SESSION["uid"]) {
 
                                if (AUTH_AUTO_LOGIN && authenticate_user($link, null, null)) {
                                    $_SESSION["ref_schema_version"] = get_schema_version($link, true);
                                         authenticate_user($link, null, null, true);
                                }
 
-                               if (!$_SESSION["uid"]) render_login_form($link);
-
-                               @session_destroy();
-                               setcookie(session_name(), '', time()-42000, '/');
-
-                               exit;
+                               if (!$_SESSION["uid"]) {
+                                       render_login_form($link);
+                                       @session_destroy();
+                                       setcookie(session_name(), '', time()-42000, '/');
+                                       exit;
+                               }
 
                        } else {
                                /* bump login timestamp */