From: Andrew Dolgov Date: Sat, 4 Mar 2006 10:58:25 +0000 (+0100) Subject: remember me feature X-Git-Tag: schema_freeze_for_1.1.4~16 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5ccc1cf5d763251fb1c8029cfd4e9f81e614a3a2;p=tt-rss.git remember me feature --- diff --git a/config.php-dist b/config.php-dist index b6131318..7787727b 100644 --- a/config.php-dist +++ b/config.php-dist @@ -108,7 +108,11 @@ // Bind sessions to specific IP address (requires DATABASE_BACKED_SESSIONS) define('SESSION_COOKIE_LIFETIME', 0); - // In seconds, 0 means delete on browser close + // Default lifetime of a session cookie. In seconds, + // 0 means delete on browser close + + define('SESSION_COOKIE_LIFETIME_REMEMBER', 3600); + // Session cookie lifetime if "remember me" is checked on login. // vim:ft=php ?> diff --git a/functions.php b/functions.php index 8822cb35..acbc3d31 100644 --- a/functions.php +++ b/functions.php @@ -802,7 +802,10 @@ } function logout_user() { - session_destroy(); + session_destroy(); + if (isset($_COOKIE[session_name()])) { + setcookie(session_name(), '', time()-42000, '/'); + } } function get_script_urlpath() { diff --git a/login.php b/login.php index bfdce9a6..40cee399 100644 --- a/login.php +++ b/login.php @@ -1,5 +1,5 @@ Password: - +   + + + diff --git a/sessions.php b/sessions.php index 42877ffe..8d46f3f5 100644 --- a/sessions.php +++ b/sessions.php @@ -107,7 +107,7 @@ db_query($session_connection, $query); } - session_set_cookie_params(SESSION_COOKIE_LIFETIME); +// session_set_cookie_params(SESSION_COOKIE_LIFETIME); if (DATABASE_BACKED_SESSIONS) { session_set_save_handler("open", "close", "read", "write", "destroy", "gc");