Fix Minecraft "Failed to Login: Invalid Session"
Failed to login: Invalid sessionBad loginInvalid session (try restarting your game)"Invalid session" means the server asked Mojang/Microsoft to verify your account and the check failed — usually a stale login session. Here's the quick client fix and the server-side cause.
"Invalid session" is almost always a stale login token on the player's side, and it clears in seconds. If it hits every player at once, it's the server's online-mode instead. The fix in order:
- Fully close Minecraft and the launcher (not just the game window).
- Reopen the launcher and let it re-authenticate your Microsoft account.
- Rejoin the server.
- Still failing? Sign out of your Microsoft account in the launcher and sign back in for a fresh token.
- If EVERY player fails at once, it's server-side — check online-mode (below).
The instant fix: restart the launcher
Nine times out of ten this is a stale session token. Fully close the Minecraft launcher and the game, reopen the launcher, and let it re-authenticate your Microsoft account. Then rejoin.
Still failing? Re-login your account
Sign out of your Microsoft account in the launcher and sign back in to force a fresh token. This clears a session that expired in the background.
The server side: online-mode
Servers with online-mode=true (the default) verify every player with Mojang. That's correct and secure. If the server runs online-mode=false (offline/cracked), authentication is skipped entirely — which has real downsides:
# server.properties
online-mode=true # verifies accounts (recommended)
online-mode=false lets anyone join under any username — including impersonating your admins — and offers no account security. Keep it true unless you specifically need offline play, and even then use a whitelist.
Other quick checks
- Check the Mojang/Minecraft services aren't down.
- If you just changed your username, wait — the change can take time to propagate.
- Make sure your system clock is correct (a wrong clock breaks auth).
"Invalid session" is a stale login. Restart the launcher to re-authenticate — it fixes it almost every time.
Why "Invalid session" keeps coming back
If restarting the launcher only fixes it briefly and the error returns, the usual culprits are a firewall, antivirus or VPN interfering with the launcher's connection to Microsoft's authentication servers, or a proxy that blocks the auth handshake. Test with the VPN/proxy off and add the launcher as an exception in your security software.
"Bad login" vs "Invalid session"
Both point at the same account-verification failure, but "Bad login" more often shows up on older/third-party launchers or when a server can't reach Mojang's session servers at all. On the server side, confirm outbound access to Minecraft's authentication endpoints isn't blocked by a firewall — a locked-down VPS can trigger this for every player at once.
How to prevent login and session errors
- Keep your launcher and game updated so token handling stays current.
- Keep the server's system clock synced with NTP — a drifted clock breaks authentication server-wide.
- Leave
online-mode=trueand add a whitelist rather than switching to offline mode to "solve" login errors. - Ensure the server can reach Mojang/Microsoft auth servers outbound if you run a tightly firewalled VPS.
Related Minecraft join errors
If the server rejects your name specifically, see Minecraft failed to verify username. For version mismatches, read outdated server / client. If the connection drops rather than the login failing, see internal exception: timed out and io.netty connection refused.
Minecraft is a trademark of Mojang Synergies AB / Microsoft. ESAGAMES is an independent hosting provider, not affiliated with or endorsed by Mojang or Microsoft.
Secure, easy Minecraft hosting
Our Minecraft hosting runs online-mode with whitelist controls and one-click setup, protected in Frankfurt.
Frequently asked questions
How do I fix "Failed to login: Invalid session"?
Fully close the game and the launcher, reopen the launcher so it re-authenticates your Microsoft account, then rejoin. If that fails, sign out and back in to force a fresh session token.
Is "invalid session" a server problem?
Usually not — it's your login session that's stale. But a server running online-mode in a misconfigured way, or Mojang services being down, can also cause it. Restart the launcher first.
Should my server use online-mode=false?
Only if you specifically need offline play, and even then add a whitelist. online-mode=false skips account verification, so anyone can join under any name, including impersonating staff. Keep it true when you can.
Why does "invalid session" happen to everyone on my server at once?
That points to the server itself, not individual players — usually Mojang/Microsoft authentication services being down, or the server being unable to reach those auth endpoints because of a firewall. Check the service status and the server's outbound access.
Can a VPN cause "Failed to login: Invalid session"?
Yes — a VPN or proxy can interfere with the launcher's handshake with Microsoft's auth servers. Disable it and re-launch to test whether that's the cause before troubleshooting further.
Does a wrong system clock really break Minecraft login?
Yes. Authentication relies on time-sensitive tokens, so a clock that's off by more than a few minutes can make the session verification fail. Sync your clock (and the server's, via NTP) and retry.
What's the difference between "Invalid session" and "Bad login"?
They stem from the same account-verification failure. "Invalid session" is the modern launcher's wording; "Bad login" tends to appear on older or third-party launchers or when the server can't reach Mojang's session servers at all.
Go deeper on this
Guides and explainers that pair with this fix — from our guides and blog.
How to Make a Minecraft Server
Set up a Java server from scratch — version, server.properties, EULA and going live.
ReadSettings to Reduce Minecraft Lag
View distance, Paper tuning and pre-generation for a smooth 20 TPS.
ReadBest Free Minecraft Plugins
EssentialsX, LuckPerms, WorldGuard and CoreProtect — the essentials.
ReadBest Minecraft Modpacks to Host
The best packs to run, and the RAM each one needs.
ReadMinecraft Modpack Hosting
One-click hosting for All the Mods, RLCraft, Cobblemon and more — with recommended RAM.
ReadRelated articles
Fix AMX Mod X "Couldn't load library" / Plugin Failed in CS 1.6
AMXX plugin stuck on "bad load", "couldn't load library" or "failed"? The real causes and the exact fix.
Read fix Game ServersFix FiveM "Couldn't load resource" / Failed to Start
A FiveM resource won't start or throws "couldn't load resource"? Here are the real causes and fixes.
Read fix Game ServersFix Rust Oxide / uMod Plugins Not Loading
Oxide/uMod plugins not loading after a Rust update? The usual causes and the quick fix.
Read fix