From: Andrew Dolgov Date: Thu, 28 Mar 2013 05:09:41 +0000 (+0400) Subject: add yet another workaround for stuck login due to session cookies X-Git-Tag: 1.7.6~222 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=60ed4c9ad50e10dc2e91991de32df5e9289ceda6;p=tt-rss.git add yet another workaround for stuck login due to session cookies --- diff --git a/classes/handler/public.php b/classes/handler/public.php index 51e50adc..798e9634 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -492,9 +492,6 @@ class Handler_Public extends Handler { } function login() { - @session_destroy(); - @session_start(); - $_SESSION["prefs_cache"] = array(); if (!SINGLE_USER_MODE) { @@ -503,6 +500,8 @@ class Handler_Public extends Handler { $password = $_POST["password"]; $remember_me = $_POST["remember_me"]; + @session_start(); + if (authenticate_user($this->link, $login, $password)) { $_POST["password"] = ""; diff --git a/include/sessions.php b/include/sessions.php index a83daea8..acb2fc38 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -107,6 +107,13 @@ if (!defined('TTRSS_SESSION_NAME') || TTRSS_SESSION_NAME != 'ttrss_api_sid') { if ($_COOKIE[$session_name]) { @session_start(); + + if (!$_SESSION["uid"]) { + session_destroy(); + if (isset($_COOKIE[session_name()])) { + setcookie(session_name(), '', time()-42000, '/'); + } + } } } ?>