diff options
-rw-r--r-- | engine/lib/sessions.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php index 862ab8f6b..fdc6d1806 100644 --- a/engine/lib/sessions.php +++ b/engine/lib/sessions.php @@ -451,9 +451,16 @@ function logout() { setcookie("elggperm", "", (time()-(86400 * 30)),"/"); + // pass along any messages + $old_msg = $_SESSION['msg']; + session_destroy(); - return true; + // starting a default session to store any post-logout messages. + session_init(NULL, NULL, NULL); + $_SESSION['msg'] = $old_msg; + + return TRUE; } /** @@ -733,4 +740,4 @@ function __elgg_session_gc($maxlifetime) { return true; } -register_elgg_event_handler("boot","system","session_init",20);
\ No newline at end of file +register_elgg_event_handler("boot","system","session_init",20); |