Locking leaves encrypted data on the device so it can be reopened later, while logging out removes the local copy and forces reauthentication. The distinction matters because the two states create very different exposure windows for stored secrets.
How the distinction works
Locking and logging out both interrupt active use, but they do it in different ways. Locking is a pause state: the app or device remains authenticated, and encrypted data stays on the device for quick reopening. Logging out is a session-ending state: local copies are removed or invalidated, and the user must authenticate again before regaining access.
That difference matters because the security boundary is not just whether the screen is visible, it is whether the underlying session and local data remain available. A locked state can be convenient and safe when the device itself is trusted and protected, but it still preserves the current access context. A logged-out state narrows the window for reuse of that context.
Why the distinction matters for exposure
The practical question is how much can still be reached if the device is lost, shared, or briefly unattended. If a user only locks the app, the encrypted local state may still be present, which can be acceptable for short interruptions but more exposed if the device or unlock path is compromised. If the user logs out, the app usually discards or invalidates the local session, reducing what remains available to the next person who touches the device.
This is why the term is more than UX wording. In security terms, lock preserves convenience and continuity, while logout reduces persistence. The right choice depends on whether the risk is casual shoulder-surfing, an exposed workstation, or a device that may later be inspected by someone else.
How applications usually implement it
Many products treat locking as a client-side control and logging out as a server-side or session control. A lock may keep a token, cached page state, or encrypted vault contents on the endpoint. A logout more often clears tokens, expires the session, and removes locally stored secrets or data fragments that would otherwise survive a lock.
Because implementations vary, teams should not assume that the words mean the same thing across apps. Some tools keep only a minimal encrypted cache after logout, while others persist recent data for sync or offline use. That is why the underlying session model matters more than the label on the button.
What to expect from a safer default
For sensitive workflows, logout is the safer default when the user is finished for the day or will leave the device unattended for an extended period. Lock is better suited to short breaks where continuity matters and the device remains within the same trusted physical control.
Users and product teams should treat the choice as a policy decision, not a habit. If the local device is the main place where secrets, tokens, or sensitive content live, then preserving them through a lock has a different risk profile from ending the session entirely.
Risk and Threat Considerations
Locking preserves a live local attack surface, so the main risk is that a stolen, shared, or briefly unattended device still contains usable session material or encrypted data that may be reopened. Logging out reduces that exposure window by invalidating the session and clearing local state, which is why it is the stronger choice when device trust is uncertain.
Failure mechanism: The session or cached local data remains present after locking, allowing someone who later gains device access, or abuses an unlocked trust path, to continue from the prior state.
Impact: Sensitive content, authenticated access, or locally stored secrets may be exposed, reused, or resumed without a fresh authentication step.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
CIS Controls v8 and NIST SP 800-53 Rev 5 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CIS Controls v8 | CIS-5 — Account Management | Distinguishes active account/session states from removed access paths. |
| Recommendation — Set clear lock and logout rules for sensitive accounts and sessions. | ||
| NIST SP 800-53 Rev 5 | AC-2 — Account Management | Logout and session termination are account lifecycle behaviors tied to access control. |
| IA-5 — Authenticator Management | Logout reduces continued use of stored authenticators or session material. | |
| AC-12 — Session Termination | Directly covers ending sessions rather than merely pausing them. | |
| Recommendation — Define when sessions must end and when access must be revoked. Limit retention and reuse of authenticators, tokens, and session artifacts. Terminate inactive or completed sessions instead of leaving them locked. | ||
| ISO/IEC 27001:2022 | A.5.15 — Access control | Access control decisions depend on whether access is suspended or ended. |
| Recommendation — Specify when users may lock versus when they must fully sign out. | ||
Practitioner Guidance
Why practitioners should care: The distinction belongs in product design, user guidance, and security policy because it determines whether a user is merely pausing work or terminating access. Make the default match the sensitivity of the data and the likelihood of device sharing, loss, or inspection.
Common misunderstanding: Many people treat lock as if it were logout, but a locked session can still preserve access context and cached material. For high-sensitivity applications, that gap should be explicit in the UI and the policy.
Related resources from NHI Mgmt Group
- What do teams get wrong about locking a vault versus logging out?
- How should organisations choose between locking a vault and logging out after timeout in high-risk environments?
- Who is accountable for deciding whether vaults should log users out instead of only locking them?
- How should security teams block AI web crawlers without locking out real users?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 11, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org