From: Andrew Dolgov Date: Thu, 28 Mar 2013 05:48:58 +0000 (+0400) Subject: reimplement remember_me X-Git-Tag: 1.7.6~219 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f231f438ba5cfefdbd6171e5bec408973db32ee2;p=tt-rss.git reimplement remember_me --- diff --git a/classes/handler/public.php b/classes/handler/public.php index 798e9634..84d6aa18 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -500,6 +500,12 @@ class Handler_Public extends Handler { $password = $_POST["password"]; $remember_me = $_POST["remember_me"]; + if ($remember_me) { + session_set_cookie_params(SESSION_COOKIE_LIFETIME); + } else { + session_set_cookie_params(0); + } + @session_start(); if (authenticate_user($this->link, $login, $password)) { diff --git a/config.php-dist b/config.php-dist index 192cb15f..3e67a248 100644 --- a/config.php-dist +++ b/config.php-dist @@ -129,7 +129,7 @@ // 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. + // like widescreen mode not saving and disable "remember me". define('SESSION_EXPIRE_TIME', 86400*30); // Hard expiration limit for sessions. Should be diff --git a/include/login_form.php b/include/login_form.php index af451239..4fc08261 100644 --- a/include/login_form.php +++ b/include/login_form.php @@ -221,6 +221,16 @@ function bwLimitChange(elem) { + 0) { ?> + +
+ + + +
+ + +
diff --git a/include/sessions.php b/include/sessions.php index acb2fc38..7ea319e3 100644 --- a/include/sessions.php +++ b/include/sessions.php @@ -102,8 +102,6 @@ "ttrss_destroy", "ttrss_gc"); } - session_set_cookie_params(SESSION_COOKIE_LIFETIME); - if (!defined('TTRSS_SESSION_NAME') || TTRSS_SESSION_NAME != 'ttrss_api_sid') { if ($_COOKIE[$session_name]) { @session_start();