diff --git a/classes/handler/public.php b/classes/handler/public.php index 798e96343..84d6aa18e 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 192cb15f9..3e67a2487 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 af451239d..4fc08261a 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 acb2fc38d..7ea319e36 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();