From 3dd46f19db3d6ce71a65ea7c1013e16125a24ccc Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 23 May 2006 06:07:38 +0100 Subject: [PATCH] mobile version uses separate sid --- functions.php | 6 +++++- login.php | 2 +- mobile/functions.php | 1 + mobile/login.php | 4 ++-- mobile/logout.php | 3 ++- mobile/tt-rss.php | 3 ++- sessions.php | 3 ++- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/functions.php b/functions.php index 0c1a959a7..c97be42c8 100644 --- a/functions.php +++ b/functions.php @@ -940,7 +940,7 @@ function basic_nosid_redirect_check() { if (!SINGLE_USER_MODE) { - if (!$_COOKIE["ttrss_sid"]) { + if (!$_COOKIE[get_session_cookie_name()]) { $redirect_uri = get_login_redirect(); $return_to = preg_replace('/.*?\//', '', $_SERVER["REQUEST_URI"]); header("Location: $redirect_uri?rt=$return_to"); @@ -1684,4 +1684,8 @@ } } + + function get_session_cookie_name() { + return ((!defined('TTRSS_SESSION_NAME')) ? "ttrss_sid" : TTRSS_SESSION_NAME); + } ?> diff --git a/login.php b/login.php index 06b95353f..a7b6ca42a 100644 --- a/login.php +++ b/login.php @@ -20,7 +20,7 @@ $password = $_POST["password"]; $return_to = $_POST["rt"]; - if ($_COOKIE["ttrss_sid"]) { + if ($_COOKIE[get_session_cookie_name()]) { require_once "sessions.php"; if ($_SESSION["uid"]) { initialize_user_prefs($link, $_SESSION["uid"]); diff --git a/mobile/functions.php b/mobile/functions.php index 6169a352f..c3d7cdb8c 100644 --- a/mobile/functions.php +++ b/mobile/functions.php @@ -1,5 +1,6 @@