"Where you're signed in": letting users end other sessions
Short answer: Customers and staff sign in to your app on phones, laptops, shared office computers and tablets, and they forget to sign out. A "Where you're signed in" page lists each active session with the device type, approximate location and last activity, and lets the user sign out any one of them or all others at once. For it to work, sessions must be tracked and ended on the server, not just by deleting a cookie, and signing out must also stop any refresh tokens tied to that session.
Why this feature earns its place
People lose phones, sell laptops, log in at a friend's house or at a hotel business centre, and share computers at work. Without a way to end those sessions remotely, the only advice you can give is "change your password and hope".
For business apps the stakes are higher: an ex-employee still signed in on a personal tablet, a shared reception computer left logged in to the booking system, or a customer worried that someone else has access to their order history. A clear session list answers "who else is in my account?" and gives an immediate fix.
Large platforms have made this familiar. Google's account help, for example, explains that users can see computers, phones and other devices where they are or were signed in recently, review their details and sign out on any they do not recognise. Your customers will expect something similar.
The server has to own sessions
The feature depends on a basic rule from OWASP's Session Management Cheat Sheet: the meaning and logic associated with a session ID must be stored on the server side, in session objects or a session store. The same cheat sheet warns that you should enforce expiration on the server and invalidate sessions at logout, because deleting a cookie alone does not invalidate a stolen copy of the session ID.
So each session needs a server-side record: a session ID, the user, when it was created, when it was last used, and some descriptive details. Signing out a device means deleting or marking that record as revoked so the next request with that ID is rejected.
If your app uses tokens rather than server sessions, the same idea applies to refresh tokens: store them server-side, link each to a device or session, and revoke them individually.
What to show in the list
Keep it simple and recognisable:
- Device and browser or app, derived from the user agent: "Chrome on Windows", "iPhone app".
- Approximate location, from the IP address at city or region level, labelled as approximate.
- Last active, such as "Active now" or "3 days ago".
- When it started, useful for spotting old forgotten sessions.
- This device, clearly marked so people do not sign themselves out by accident.
Let users give a device a friendly name if it helps, and avoid showing raw IP addresses to non-technical users.
The actions
- Sign out this session. Ends one session immediately.
- Sign out all other sessions. The quick fix after a lost phone or a suspicion.
- Sign out everywhere, including this device, for use alongside a password change.
OWASP's cheat sheet notes that during sensitive changes such as password changes and permission changes, previous session IDs should be ignored and only the current one assigned. In practice, after a password change, offer or automatically perform "sign out other sessions", and tell the user you did.
Admin controls for business apps
In apps used by teams, administrators need the same power over staff accounts:
- View a staff member's active sessions.
- Sign out all sessions when someone leaves or loses a device.
- Ideally, do this automatically when an account is disabled.
Log every remote sign-out, recording who did it and when, so the action can be checked later.
Notifications and suspicious sign-ins
The session list pairs well with new sign-in alerts: an email or push notification saying "New sign-in on Firefox in Wellington. Wasn't you? Review your sessions." Link straight to the session page. Keep alerts for genuinely new devices, not every sign-in, or people stop reading them.
Edge cases
- Remember-me cookies. Long-lived logins must be revocable too; they are often the forgotten sessions.
- Mobile apps. Revoking a session should make the app return to the sign-in screen gracefully on its next request.
- Clean-up. Expire inactive sessions after a sensible period so the list does not grow endlessly.
- Accuracy. Location from IP addresses can be wrong, especially on mobile networks and VPNs; say so.
Testing it end to end
Sign in on two browsers and a phone, then use the page from one of them to end the others. Check that each ended session is rejected on its very next request, not after a cache expires, that the mobile app returns cleanly to its sign-in screen, and that background refreshes cannot quietly revive a revoked session. Repeat after a password change and after an admin disables the account, since those are the moments people will rely on it.
A worked example
Consider a hypothetical Birmingham recruitment agency whose consultants used a candidate-management web app on office PCs, home laptops and phones. After a consultant left and was found still signed in on a personal tablet, the agency asked for better control.
The developers moved session data to a server-side store, added a "Where you're signed in" page showing device, approximate city and last activity, and buttons to sign out one session or all others. Admins can now end all sessions for any staff account, and disabling a user does it automatically. A password change prompts to sign out other sessions, and new-device sign-ins trigger an email linking to the page.
FAQ
Do I need this for a small customer-facing app?
It is most valuable where accounts hold personal or business data. Even a simple "sign out everywhere" button is a good start.
Does this replace two-factor authentication?
No. It complements it by letting people end sessions that already exist.
Can I show the exact address of a sign-in?
IP-based location is approximate. Show city or region and avoid implying more precision.
If you'd like your app to show users where they're signed in and let them end sessions remotely, tell us how logins work today.