Misja Hoebe <misja@curverider.co.uk> Added comment to allow transfer by some FTP...
[elgg.git] / login / logout.php
blob23b3a344efb9b691f491fd82a9fd86c79508b595
1 <?php
3 require_once(dirname(dirname(__FILE__))."/includes.php");
5 $user->code = '';
6 $user->ident = $USER->ident;
7 if ($USER->ident) { //for some reason this can run with user id 0...?
8 update_record('users',$user);
11 unset($USER);
12 unset($SESSION);
13 unset($_SESSION['USER']);
14 unset($_SESSION['SESSION']);
15 unset($_SESSION['userid']);
16 unset($_SESSION['username']);
17 unset($_SESSION['name']);
18 unset($_SESSION['email']);
19 unset($_SESSION['icon']);
20 unset($_SESSION['icon_quota']);
22 if (isset($_COOKIE[session_name()])) {
23 setcookie(session_name(), '', time()-84600, $CFG->cookiepath);
26 // Remove the any AUTH_COOKIE persistent logins
27 setcookie(AUTH_COOKIE, '', time()-84600, $CFG->cookiepath);
29 session_destroy();
31 // Set headers to forward to main URL
32 header("Location: " . $CFG->wwwroot . "\n");