If you see the error “A specified logon session does not exist. It may already have been terminated” on Windows 10, the fix is usually to restart the Windows User Mode Driver Framework service or clear the cached logon sessions in the registry. This error commonly appears when trying to print, access network shares, or use certain apps after a user logs off or the system wakes from sleep. Below is a step-by-step guide to resolve it, plus background on why it happens and how to prevent it.
Why This Error Occurs
The message comes from Windows Security (the Local Security Authority Subsystem Service, or LSASS) when an application or service tries to use a logon session token that has already been closed. A logon session is created when a user authenticates (logs on) and is destroyed when the user logs off or the session is explicitly terminated. If a background process, printer driver, or scheduled task still holds a reference to that old token, Windows returns this error.
Common triggers include:
- Printing after the computer has been idle or asleep for a long time.
- Accessing a mapped network drive after reconnecting to a VPN.
- Running a scheduled task that uses a stored credential that has expired.
- Using an application that caches user credentials (like some remote desktop tools).
Quick Fix: Restart the User Mode Driver Framework
For many users, especially those seeing the error when printing, restarting the User Mode Driver Framework (UMDF) service clears the stale session. Here’s how:
- Press Win + R, type
services.msc, and press Enter. - Scroll down to User Mode Driver Framework Service (or “User Mode Driver Framework Host”).
- Right-click it and select Restart. If it’s not running, start it.
- Try the operation that failed (print, access drive, etc.) again.
If that doesn’t work, reboot the computer. A full restart clears all logon sessions and usually resolves the error temporarily.
Clear Stale Logon Sessions in the Registry
If the error persists, you can manually remove orphaned logon session entries. This should be done carefully—back up the registry first. The sessions are stored under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\LogonSession
Steps:
- Open Registry Editor (Win + R, type
regedit). - Navigate to the key above.
- You’ll see subkeys with GUID names. Each represents a logon session.
- Right-click each subkey and select Delete. Note: do not delete the entire LogonSession key, only the subkeys inside it.
- Close Registry Editor and restart the computer.
Warning: Incorrectly editing the registry can cause system instability. Only delete entries that seem old or that you suspect are causing the issue. If you’re not comfortable, skip this and try other methods.
Update or Reinstall the Problematic Driver
Often the error is tied to a specific device driver, particularly printer drivers. Manufacturers may release updates that fix how the driver handles logon sessions. Go to Device Manager (right-click Start > Device Manager), find the device (e.g., printer), right-click it, and choose Update driver. If no update is available, uninstall the device and reinstall it. For printers, it’s often better to uninstall the software completely and reinstall the latest version from the manufacturer’s website.
Check Scheduled Tasks and Credential Manager
Scheduled tasks that run with stored credentials can cause this error if the password changes or the session expires. To fix:
- Open Task Scheduler (search for it).
- Look for tasks that run under a specific user account. Right-click and select Run to test. If it fails, update the stored password in the task’s properties.
- Open Credential Manager (Control Panel > Credential Manager) and remove any saved credentials for the resource that’s failing. Then re-add them.
When to Use System Restore or Reset
If the error started after a recent update or software installation, you can use System Restore to revert to a point before the issue. Type rstrui in the Run box and follow the prompts. If nothing else works, a Windows 10 “Reset this PC” (keeping your files) can clear deep system issues, but this is a last resort.
Frequently Asked Questions
Does this error mean my computer is hacked?
No. It’s a common Windows bug related to session management, not a security breach. However, if you see it repeatedly with other odd behavior, run a malware scan just to be safe.
Why does it happen after sleep or hibernate?
When the system sleeps, some services and drivers may not properly handle the logon session state. When waking, they try to use an old token that has been invalidated. Restarting the service or a reboot fixes it.
Can I prevent this error from happening?
Yes, keep Windows and drivers updated. For printers, install the latest manufacturer drivers. Avoid using “sleep” for long periods if the error is frequent—use “hibernate” or shut down instead.
Is it safe to delete registry keys under LogonSession?
Generally yes, if you only delete subkeys and not the main key. But always back up the registry first. Deleting active sessions could cause you to be logged out, so it’s best done after logging off other users.
Will this error affect my files?
No, it doesn’t damage files. It only prevents certain operations (printing, network access) from working until you fix it.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix Text Cursor Turning White in Windows 11
- Force Quit Non-Responding Apps on Mac: 6 Ways
- Chromebook Not Charging? Fix It Fast
- iPhone Won’t Make Calls but Texts Work? Fixes
- Android to iPhone Hotspot: Connect & Fix Issues
- Fix Bluetooth Not Working on Discord Mobile