You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Getting or listing another user's sessions marks those sessions as accessed #56309
Get session (GET /api/latest/fleet/sessions/:id) and List sessions (GET /api/latest/fleet/users/:id/sessions) update accessed_at on every session they return, not only on the session used to make the request.
Session duration is an inactivity timeout, so anything that periodically lists or gets other users' sessions keeps those sessions alive indefinitely. It also makes those users count as active for the "Inactive" user status added in 4.92.0, because last_activity_at is MAX(sessions.accessed_at).
🛠️ Expected behavior
Only the session used to authenticate the request has its accessed_at updated. Getting or listing sessions doesn't change them.
🧑💻 Steps to reproduce
These steps:
Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
Log in as user B, then note the accessed_at of B's session: SELECT id, user_id, accessed_at FROM sessions WHERE user_id = <B's id>.
With an admin user A's API token, call GET /api/latest/fleet/users/<B's id>/sessions (or GET /api/latest/fleet/sessions/<B's session id>).
Run the query from step 1 again: B's session accessed_at is now the time of A's request.
🕯️ More info (optional)
validateSession (server/service/sessions.go) calls MarkSessionAccessed, and it runs for the sessions being returned by GetInfoAboutSession and GetInfoAboutSessionsForUser, not only for the caller's session in GetSessionByKey.
QA Pass — 12/12 checks on main (4e08a7f) vs fleet-v4.94.0. Get and List sessions across API prefixes and caller types (admin, API-only admin, the user themself), the caller's own session still sliding, response shape and delete, Users-page last activity, and the real inactivity timeout (3m).
#
Type
Case
Pre-fix
Fixed
1
Core
Admin lists another user's sessions
❌ reproduced (all their sessions' accessed_at bumped)
✅ unchanged
2
Core
Admin gets one of another user's sessions
❌ reproduced
✅ unchanged
3
Core
Same on /api/latest and /api/2022-04
❌ reproduced
✅ unchanged
4
Core
Caller is an API-only admin
❌ reproduced
✅ unchanged
5
Core
User lists own sessions — their other session isn't touched
❌ reproduced
✅ only the session used
6
Regression
Caller's own session still refreshed on every request
✅
✅
7
Regression
User's own request refreshes only the session it used
✅
✅
8
Regression
List/Get response shape; deleting a session ends only that one
✅
✅ unchanged
9
Halo
Users page "last activity" not moved by an admin listing sessions
❌ reproduced
✅ unchanged
10
Core
User idle past the 3m timeout while an admin lists their sessions every 50s
❌ reproduced (session stayed valid)
✅ session expired (401)
Row 10 is the user impact: before the fix, anything that periodically lists sessions keeps every listed session alive indefinitely.
Activity
Bug: Listing or getting another users session marks that session as a…
xpkoala commentedon Nov 3, 2026
QA Pass — 12/12 checks on
main(4e08a7f) vsfleet-v4.94.0. Get and List sessions across API prefixes and caller types (admin, API-only admin, the user themself), the caller's own session still sliding, response shape and delete, Users-page last activity, and the real inactivity timeout (3m).accessed_atbumped)/api/latestand/api/2022-04Row 10 is the user impact: before the fix, anything that periodically lists sessions keeps every listed session alive indefinitely.