From 2feee92a75d4fe7042be52d1eef4e6e466af4967 Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Tue, 8 Jul 2008 18:56:42 +0200 Subject: Remember user between sessions. Signed-off-by: Loui Chang --- web/lib/acctfuncs.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web/lib') diff --git a/web/lib/acctfuncs.inc b/web/lib/acctfuncs.inc index bbd6b740..73db2708 100644 --- a/web/lib/acctfuncs.inc +++ b/web/lib/acctfuncs.inc @@ -644,7 +644,12 @@ function try_login() { if ($logged_in) { # set our SID cookie - setcookie("AURSID", $new_sid, 0, "/"); + if ($_POST['remember_me'] == "on") + # Set cookies for 30 days. + $cookie_time = time() + (60 * 60 * 24 * 30); + else + $cookie_time = 0; + setcookie("AURSID", $new_sid, $cookie_time, "/"); # header("Location: /index.php"); header("Location: " . $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); $login_error = ""; -- cgit v1.2.3-24-g4f1b