]> git.wh0rd.org Git - tt-rss.git/commitdiff
do not use session cookie lifetime for additional cookies
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 29 Apr 2013 09:03:28 +0000 (13:03 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 29 Apr 2013 09:03:28 +0000 (13:03 +0400)
classes/pref/prefs.php
classes/rpc.php
config.php-dist
include/functions.php

index 47f47ae680d38924415da9e67174f31f5bd3176f..35065ea7b262d2314f591d5cc4912830c10a4742 100644 (file)
@@ -114,7 +114,7 @@ class Pref_Prefs extends Handler_Protected {
                        if ($pref_name == "language") {
                                if ($_SESSION["language"] != $value) {
                                        setcookie("ttrss_lang", $value,
-                                               time() + SESSION_COOKIE_LIFETIME);
+                                               time() + COOKIE_LIFETIME_LONG);
                                        $_SESSION["language"] = $value;
 
                                        $need_reload = true;
index 62d884673473db5a59b8a1359265bfad5060e530..2b07bbf9117255942899f384515cfb85b3c1772e 100644 (file)
@@ -479,7 +479,7 @@ class RPC extends Handler_Protected {
                $wide = (int) $_REQUEST["wide"];
 
                setcookie("ttrss_widescreen", $wide,
-                       time() + SESSION_COOKIE_LIFETIME);
+                       time() + COOKIE_LIFETIME_LONG);
 
                print json_encode(array("wide" => $wide));
        }
index 72b6fd1b87ad6a7530b2edc34bc94ae8896fe7f1..58218bab1519dc80a2b966915db2475a68c99add 100644 (file)
        define('SESSION_COOKIE_LIFETIME', 86400);
        // Default lifetime of a session (e.g. login) cookie. In seconds, 
        // 0 means cookie will be deleted when browser closes.
-       // Setting this to zero will affect several user preferences
-       // like widescreen mode not saving and disable "remember me".
-       // Note that if remember me is not checked, session cookie
-       // will always expire with browser session.
 
        define('SESSION_CHECK_ADDRESS', 1);
        // Check client IP address when validating session:
index 5da657f2d72fa47bde62c5a04fc5a5da8c7f4948..38c3eac32e9f49992af671057db56170a1b95152 100644 (file)
@@ -5,6 +5,8 @@
        define('LABEL_BASE_INDEX', -1024);
        define('PLUGIN_FEED_BASE_INDEX', -128);
 
+       define('COOKIE_LIFETIME_LONG', 86400*365);
+
        $fetch_last_error = false;
        $fetch_last_error_code = false;
        $fetch_last_content_type = false;
                                $_SESSION["last_login_update"] = time();
                        }
 
-                       if ($_SESSION["uid"] && $_SESSION["language"] && SESSION_COOKIE_LIFETIME > 0) {
+                       if ($_SESSION["uid"] && $_SESSION["language"]) {
                                setcookie("ttrss_lang", $_SESSION["language"],
-                                       time() + SESSION_COOKIE_LIFETIME);
+                                       time() + COOKIE_LIFETIME_LONG);
                        }
 
                        if ($_SESSION["uid"]) {