Fix “Failed to verify username” and “Invalid session” in Minecraft
When you join a server with online-mode on, it asks Minecraft's login servers to confirm your account. “Failed to verify username!” and “Invalid session” mean that check failed. Restarting the launcher fixes it most of the time. If it doesn't, the cause is in the login service, your network or the server's proxy setup.
What each message means
| Message | What it usually means |
|---|---|
| Failed to verify username! | The server could not confirm your account with Minecraft's login servers. |
| Invalid session (Try restarting your game) | Your game's sign-in has expired, or it did not reach Minecraft's servers. |
| Authentication servers are down. Please try again later, sorry! | The server could not reach Minecraft's login servers, or they are down. |
| You logged in from another location | The same account joined from a second place and replaced your connection. |
Fixes for players
- Restart the launcher and sign in again. Sign out, close the launcher completely, open it and sign in. This fixes most “Invalid session” errors.
- Use the right account. A server with online-mode on only accepts accounts that own Minecraft: Java Edition. Check that you are signed in with that Microsoft account.
- Check your date and time. Secure connections fail when your clock is wrong. Set it to update automatically.
- Turn off your VPN and try another network. Flush your DNS if the problem stays.
- Join from one place only. Close Minecraft on any other device that uses your account.
- Wait and try again. Minecraft's login services have outages from time to time. If other players on the server see the same error, nothing on your side is wrong.
Fixes for server owners
1. Check that the server can reach the login servers
The server contacts Mojang's session servers for every login. Test the connection from the server:
curl -sI https://sessionserver.mojang.com | head -n 1
Any HTTP status line means the connection works. “Could not resolve host” or a timeout means DNS or outgoing traffic is blocked: check that the server has a working DNS server, and that the firewall allows outgoing HTTPS on port 443 and DNS on port 53.
2. Keep online-mode on
Setting online-mode=false in server.properties switches the check off, but it lets anyone join under any name, including the name of one of your admins. Leave it true on a public server. The one exception is a game server behind a proxy that checks accounts for it.
3. Set up proxies correctly
On a Velocity or BungeeCord network, the proxy runs with online-mode on and passes the player's identity to the game servers with forwarding. Turn on forwarding on both sides, use the same secret where the proxy asks for one, and make the game servers reachable only from the proxy, with a firewall rule. A game server that is open to the internet with online-mode off lets anyone join as any player.
4. Check the server's clock
A wrong system time breaks the secure connection to the login servers. On Linux, run timedatectl and check that the clock is synchronized.
5. During an outage
When Minecraft's login services are down, nobody can join a server with online-mode on. Wait for them to recover instead of changing your settings.
Still stuck?
Note the exact message, the time, and whether one player or everyone is affected. If only one player sees it, the fix is on their side.
Host your Minecraft server in Singapore
Low ping for players in India, Malaysia and Indonesia, on fast AMD EPYC cores with NVMe and DDoS protection.
