mobile version uses separate sid

This commit is contained in:
Andrew Dolgov 2006-05-23 06:07:38 +01:00
parent 757e8a2dae
commit 3dd46f19db
7 changed files with 15 additions and 7 deletions

View file

@ -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);
}
?>

View file

@ -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"]);

View file

@ -1,5 +1,6 @@
<?
define('MOBILE_FEEDLIST_ENABLE_ICONS', false);
define('TTRSS_SESSION_NAME', 'ttrss_m_sid');
function render_feeds_list($link) {

View file

@ -1,5 +1,5 @@
<?
// require_once "sessions.php";
require_once "functions.php";
require_once "../version.php";
require_once "../config.php";
@ -19,7 +19,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"]);

View file

@ -1,8 +1,9 @@
<?
require_once "../sessions.php";
require_once "functions.php";
require_once "../config.php";
require_once "../functions.php";
require_once "../sessions.php";
logout_user();

View file

@ -1,6 +1,7 @@
<?
require_once "../functions.php";
require_once "../config.php";
require_once "functions.php";
require_once "../functions.php";
basic_nosid_redirect_check();

View file

@ -5,9 +5,10 @@
require_once "db.php";
$session_expire = SESSION_EXPIRE_TIME; //seconds
$session_name = (!defined('TTRSS_SESSION_NAME')) ? "ttrss_sid" : TTRSS_SESSION_NAME;
ini_set("session.gc_probability", 50);
ini_set("session.name", "ttrss_sid");
ini_set("session.name", $session_name);
ini_set("session.use_only_cookies", true);
ini_set("session.gc_maxlifetime", SESSION_EXPIRE_TIME);