| Previous | Next |
| ERROR_NO_SUCH_PACKAGE | ERROR_LOGON_SESSION_COLLISION |
ERROR_BAD_LOGON_SESSION_STATE
A logon session exists, but it is not in a state that permits the requested operation
Logon sessions have a lifecycle tied to authentication, token creation, credential/package state, and termination. This error differs from ERROR_NO_SUCH_LOGON_SESSION: LSA recognizes the session identifier, but the requested transition or package operation does not fit the session state. The underlying cause is therefore usually ordering, duplicate completion, or teardown concurrency rather than account-name resolution.
Capture the AuthenticationId and the exact LSA/package operation that failed. Trace session creation, token issuance, credential insertion/removal, and termination notifications in order. For custom authentication code, check error paths that can call cleanup twice or continue after a failed logon. For diagnostic tools, consider that a live session can begin termination after enumeration. Retrying blindly can worsen duplicate-state bugs; first determine the lifecycle transition the caller expected and the state LSA had already reached.
What to inspect
- Record the AuthenticationId and exact operation rejected by LSA.
- Trace creation, credential/package operations, and termination in chronological order.
- Check duplicate completion and cleanup paths for custom authentication packages.
References
Looking for a different code? Search another status or error code.