Hi @Yosyp
The comparison with the desktop client is understandable, but the two work fundamentally differently under the hood.
The desktop client does not use session cookies at all. It authenticates with app tokens — essentially a form of Basic Auth. Each configured account gets its own independent token, and multiple tokens can coexist without conflict because every request carries its own credentials. There is no shared session state.
A browser is different. A session cookie grants access to an entire session — once you are logged in, every tab you open in that browser profile authenticates automatically via that one cookie. That is exactly what makes it convenient, and exactly what makes having two cookies simultaneously a huge security problem: a stolen cookie would give an attacker full session access. This is not a limitation Nextcloud could easily lift — it is how browser-based authentication works across the web.
A session cookie is identified by a fixed name scoped to the domain — there can only be one value under that name at a time. A second login simply overwrites it.
Multiple active sessions in the same browser profile are therefore intentionally not supported — and in virtually every other web service either. If multiple cookies could be valid at the same time, a stolen session cookie gives an attacker full access as that user — the server has no way to tell their requests apart from yours.
The cleanest solution for the use case you describe is browser profiles. Firefox, Chrome, and Edge all support them: each profile has its own cookie storage, so you can have two browser windows open with different accounts simultaneously. This is the approach I would generally recommend.
Personally, I use the Impersonate app for this, because I don’t want to maintain an additional browser profile — browser profiles also quickly start consuming a significant amount of memory.
The workflow: log in as admin, open the user list, and click Impersonate for the desired account. The browser switches into that user’s session. To switch back: simply log out of the impersonated account — and you are automatically back in your admin session, no re-login required.
One limitation: the Impersonate app only works in one direction. You start as admin and switch to a user, not the other way around.
h.t.h.
ernolf