summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorAndrea Scarpino <bash.lnx@gmail.com>2008-07-08 18:56:42 +0200
committerLoui Chang <louipc.ist@gmail.com>2008-07-08 20:06:16 +0200
commit2feee92a75d4fe7042be52d1eef4e6e466af4967 (patch)
treefc14df6bd5de072ff70d1d7cc6f0cec497f330cd /web/lib
parent36ee5561035af335bc3c900ded7aa89066421226 (diff)
downloadaur-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.inc7
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 = "";