Skip to content

PhoenixKit 2.22.18: Revoked sessions close open tabs, and remembered accounts

PhoenixKit 2.22.18 fixes a security gap: signing a session out did not stop a tab that was already open.

Signing out a device, signing out everywhere, deactivating a user, an admin password reset and a password change all deleted the session, but an open page kept working as the signed-out user until it was reloaded. The message meant to close those pages never arrived. Open pages of a revoked session are now disconnected at once.

The account switcher also lost every added account when the browser was restarted, keeping only the remembered login. The added accounts are now kept in a second cookie and come back with it. This only happens for a browser that already has a remembered login, and the list is cleared on sign-out, on a new sign-in and when multiple accounts are turned off. An impersonation session is never kept.

On the user detail page, Basic Information now shows the Account Type for every account, and a person linked to an organization shows the organization’s name as a link instead of its ID.

Full release notes: PhoenixKit 2.22.18

2.22.18 · 11 September 2026

Security

  • Revoking a session now actually closes the tab it belongs to. Every path that drops session tokens — “Sign out this device”, “sign out everywhere”, deactivating a user, an admin password reset, a password change, the external-proof confirmation — deleted the row and left any already-connected LiveView running. A socket keeps its assigns, an authenticated scope included, and goes on serving events until it re-mounts, so the account an operator had just cut off kept working in an open tab. Two defects stacked: the only function that broadcast the disconnect had no callers, and the broadcast itself resolved PhoenixKitWeb.Endpoint — a module that ships in this library but that nothing starts inside a host app, so it raised “no :pubsub_server configured”, was swallowed by a rescue, and disconnected nothing anywhere. Disconnects now go to the host’s endpoint (via PhoenixKit.Config.get_parent_endpoint/0) and are part of the token drain itself, so a future revocation path cannot forget them.

Fixed

  • The user detail page names the account type and the organization. “Basic Information” showed an “Account Type” row only for organization accounts, so the answer for everyone else lived in the summary card — not where you look first. A person account linked to an organization showed the organization’s raw uuid; it now renders the organization’s name as a link to it, the same way the summary card already did.

  • The account switcher no longer forgets accounts when the browser’s session cookie goes away. The multi-account stack lived only in the Plug session, which on a stock mix phx.new endpoint is a browser-session cookie — so at browser restart the remember-me cookie restored the one identity it holds and every account the user had added silently disappeared, with no error and nothing in the activity log. Added accounts are now mirrored into a second persistent cookie and the whole stack comes back with the remembered login. The mirror is written only for a browser that already holds a remember-me cookie (a deliberately session-only login stays session-only), is bound to the root token it was created under (so a stale mirror cannot attach itself to the next person who signs in on a shared computer), drops tokens that no longer resolve to an active user, and is cleared on logout, on a fresh login, and when multi_session_enabled is turned off. An impersonation is never mirrored: “sign in as this user” still ends with the browser session.


PhoenixKit 2.22.18. Install or update: {:phoenix_kit, "~> 2.22"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.