From 6460a2eeb72c95c77f7a9966e5f5b2441e2a8932 Mon Sep 17 00:00:00 2001 From: "andrew.ha" Date: Thu, 31 Jul 2025 19:46:49 +0800 Subject: [PATCH] Make logout function more robust to prevent session issues Improve cookie cleanup during logout by removing cookies across multiple paths and domains to ensure complete session termination. Fixes #11078 --- ui/src/store/modules/user.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/src/store/modules/user.js b/ui/src/store/modules/user.js index 6113f3ed9406..5c9dff69f960 100644 --- a/ui/src/store/modules/user.js +++ b/ui/src/store/modules/user.js @@ -472,9 +472,17 @@ const user = { }).catch(() => { resolve() }).finally(() => { + const paths = ['/', '/client'] + const hostname = window.location.hostname + const domains = [undefined, hostname, `.${hostname}`] Object.keys(Cookies.get()).forEach(cookieName => { - Cookies.remove(cookieName) - Cookies.remove(cookieName, { path: '/client' }) + paths.forEach(path => { + domains.forEach(domain => { + const options = { path } + if (domain) options.domain = domain + Cookies.remove(cookieName, options) + }) + }) }) }) })