From c5bca0279c82f7f86e73d0ceb5fe49347d6e2fa7 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 20 Jul 2024 13:09:05 +0000 Subject: Revert "Revert "sse: reset session after connection aborted"" This reverts commit c71eb401c04c5ae2e5388f988825b072f3c113df --- Zotlabs/Module/Sse.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Sse.php b/Zotlabs/Module/Sse.php index a5b5c7e35..daf344f2d 100644 --- a/Zotlabs/Module/Sse.php +++ b/Zotlabs/Module/Sse.php @@ -41,8 +41,6 @@ class Sse extends Controller { } } - - if (self::$uid) { self::$vnotify = get_pconfig(self::$uid, 'system', 'vnotify'); } @@ -138,8 +136,17 @@ class Sse extends Controller { } if (connection_status() != CONNECTION_NORMAL || connection_aborted()) { + + // IMPORTANT: in case the channel was changed we need to reset the + // session here to it's current stored state. + // Otherwise the uid might switch back to the previous value + // in the background. + + session_reset(); + XConfig::Set(self::$ob_hash, 'sse', 'timestamp', NULL_DATE); XConfig::Set(self::$ob_hash, 'sse', 'notifications', []); + $_SESSION['sysmsg'] = []; $_SESSION['sysmsg_info'] = []; -- cgit v1.2.3