root/releases/0.673/login/logout.php

Revision 691, 0.7 kB (checked in by sven, 2 years ago)

try to detect if we're in a subdirectory, and define $CFG->cookiepath with that path to allow elgg-specific cookies

  • Property svn:eol-style set to native
Line 
1 <?php
2
3 require_once(dirname(dirname(__FILE__))."/includes.php");
4
5 $user->code = '';
6 $user->ident = $USER->ident;
7 update_record('users',$user);
8
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']);
19
20 if (isset($_COOKIE[session_name()])) {
21     setcookie(session_name(), '', time()-84600, $CFG->cookiepath);
22 }
23
24 // Remove the any AUTH_COOKIE persistent logins
25 setcookie(AUTH_COOKIE, '', time()-84600, $CFG->cookiepath);
26
27 session_destroy();
28
29 // Set headers to forward to main URL
30 header("Location: " . url . "\n");
31
32     
33 ?>
Note: See TracBrowser for help on using the browser.