Direct connect to lan causes: failed to login invalid session [duplicate]

Try doing this:

  1. Start Minecraft on both the computer being connected to (Host) and the one connecting (Player)
  2. On the Host computer under Singleplayer, start the world you want the Player to connect to.
  3. Press Esc and click 'Open to LAN' and configure the settings there, then click 'Start LAN World'
    • This will output 'Local game hosted on port XXXXX
  4. On the Payer computer, make sure you're connected to the same WiFi as the Host, then click Multiplayer.
    • It will say 'Scanning for games on your local network'
  5. If set up correctly, the game will appear at the bottom of the server list with the username of the Host.

Hope this works for you.