add yet another workaround for stuck login due to session cookies

This commit is contained in:
Andrew Dolgov 2013-03-28 09:09:41 +04:00
parent 79bb55892b
commit 60ed4c9ad5
2 changed files with 9 additions and 3 deletions

View File

@ -492,9 +492,6 @@ class Handler_Public extends Handler {
} }
function login() { function login() {
@session_destroy();
@session_start();
$_SESSION["prefs_cache"] = array(); $_SESSION["prefs_cache"] = array();
if (!SINGLE_USER_MODE) { if (!SINGLE_USER_MODE) {
@ -503,6 +500,8 @@ class Handler_Public extends Handler {
$password = $_POST["password"]; $password = $_POST["password"];
$remember_me = $_POST["remember_me"]; $remember_me = $_POST["remember_me"];
@session_start();
if (authenticate_user($this->link, $login, $password)) { if (authenticate_user($this->link, $login, $password)) {
$_POST["password"] = ""; $_POST["password"] = "";

View File

@ -107,6 +107,13 @@
if (!defined('TTRSS_SESSION_NAME') || TTRSS_SESSION_NAME != 'ttrss_api_sid') { if (!defined('TTRSS_SESSION_NAME') || TTRSS_SESSION_NAME != 'ttrss_api_sid') {
if ($_COOKIE[$session_name]) { if ($_COOKIE[$session_name]) {
@session_start(); @session_start();
if (!$_SESSION["uid"]) {
session_destroy();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
}
} }
} }
?> ?>