From 9003094e5dd355a8f63ef39b429e4c7b9a7ce687 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 27 Jan 2010 15:58:27 +0000 Subject: Fixes #1464: A new session is created in logout() after destorying the old session to display old $_SESSION['msg'] messages. git-svn-id: http://code.elgg.org/elgg/trunk@3847 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/sessions.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'engine/lib/sessions.php') 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); -- cgit v1.2.3