diff options
author | Andrea Scarpino <bash.lnx@gmail.com> | 2008-07-08 18:56:42 +0200 |
---|---|---|
committer | Loui Chang <louipc.ist@gmail.com> | 2008-07-08 20:06:16 +0200 |
commit | 2feee92a75d4fe7042be52d1eef4e6e466af4967 (patch) | |
tree | fc14df6bd5de072ff70d1d7cc6f0cec497f330cd /web/lib | |
parent | 36ee5561035af335bc3c900ded7aa89066421226 (diff) | |
download | aur-2feee92a75d4fe7042be52d1eef4e6e466af4967.tar.gz aur-2feee92a75d4fe7042be52d1eef4e6e466af4967.tar.xz |
Remember user between sessions.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/acctfuncs.inc | 7 |
1 files changed, 6 insertions, 1 deletions
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 = ""; |