aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/sessions.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php
index 790f11b1a..c302ed3cc 100644
--- a/engine/lib/sessions.php
+++ b/engine/lib/sessions.php
@@ -75,6 +75,9 @@
$_SESSION['code'] = $code;
+ if (($persistent))
+ setcookie("elggperm", $code, (time()+(86400 * 30)),"/");
+
if (!$user->save() || !trigger_event('login','user',$user)) {
unset($_SESSION['username']);
unset($_SESSION['name']);
@@ -82,11 +85,9 @@
unset($_SESSION['guid']);
unset($_SESSION['id']);
unset($_SESSION['user']);
+ setcookie("elggperm", "", (time()-(86400 * 30)),"/");
return false;
}
-
- if (($persistent))
- setcookie("elggperm", $code, (time()+(86400 * 30)),"/");
return true;