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 @@