Fixing a stupid mistake
[elgg.git] / login / logout.php
blob36e4d9a7fa2ec3c87d487aca9e46dedb47b35eaa
1 <?php
3 require_once(dirname(dirname(__FILE__))."/includes.php");
5 $user->code = '';
6 $user->ident = $USER->ident;
7 update_record('users',$user);
9 unset($USER);
10 unset($SESSION);
11 unset($_SESSION['USER']);
12 unset($_SESSION['SESSION']);
13 unset($_SESSION['userid']);
14 unset($_SESSION['username']);
15 unset($_SESSION['name']);
16 unset($_SESSION['email']);
17 unset($_SESSION['icon']);
18 unset($_SESSION['icon_quota']);
20 if (isset($_COOKIE[session_name()])) {
21 setcookie(session_name(), '', time()-84600, $CFG->cookiepath);
24 // Remove the any AUTH_COOKIE persistent logins
25 setcookie(AUTH_COOKIE, '', time()-84600, $CFG->cookiepath);
27 session_destroy();
29 // Set headers to forward to main URL
30 header("Location: " . url . "\n");