From 8e849206dd5f049c3b2867bb9f7d9c25aa0ba807 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 1 Mar 2007 13:29:25 +0100 Subject: [PATCH] login system fixes (2) --- functions.js | 4 +++- functions.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/functions.js b/functions.js index 35b1e1319..991c0715d 100644 --- a/functions.js +++ b/functions.js @@ -56,6 +56,8 @@ function logout_callback() { var container = document.getElementById('notify'); if (xmlhttp.readyState == 4) { try { + var date = new Date(); + var timestamp = Math.round(date.getTime() / 1000); window.location.href = "tt-rss.php"; } catch (e) { exception_error("logout_callback", e); @@ -1538,7 +1540,7 @@ function fatalError(code, message) { try { if (code == 6) { - //window.location.href = "login.php?rt=none"; + window.location.href = "tt-rss.php"; } else if (code == 5) { window.location.href = "update.php"; } else { diff --git a/functions.php b/functions.php index 59086506a..70cc16cc9 100644 --- a/functions.php +++ b/functions.php @@ -1170,7 +1170,7 @@ if ($_SESSION["cookie_lifetime"] && $_SESSION["uid"]) { -# print time() . " vs " . $_SESSION["cookie_lifetime"]; + //print_r($_SESSION); if (time() > $_SESSION["cookie_lifetime"]) { return false; @@ -1210,7 +1210,7 @@ if ($remember_me) { $_SESSION["cookie_lifetime"] = time() + SESSION_COOKIE_LIFETIME_REMEMBER; - } else { + } else if (SESSION_COOKIE_LIFETIME > 0) { $_SESSION["cookie_lifetime"] = time() + SESSION_COOKIE_LIFETIME; }