mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
UI: Make logout function more robust to prevent session issues (#11361)
Improve cookie cleanup during logout by removing cookies across multiple paths and domains to ensure complete session termination. Fixes #11078
This commit is contained in:
parent
adec5f439d
commit
af2a911f1b
@ -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)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user