diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-01-27 15:58:27 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-01-27 15:58:27 +0000 |
commit | 9003094e5dd355a8f63ef39b429e4c7b9a7ce687 (patch) | |
tree | 1fa207b10ef193f5441acab16a81171c7414ccbb /engine/lib | |
parent | 771e4314a7392f5e8467c35d78984ec9d1ac3ba4 (diff) | |
download | elgg-9003094e5dd355a8f63ef39b429e4c7b9a7ce687.tar.gz elgg-9003094e5dd355a8f63ef39b429e4c7b9a7ce687.tar.bz2 |
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
Diffstat (limited to 'engine/lib')
-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); |