tickets

hybrilior #8

After a server restart a page reconnects to a new anonymous session that its cookie does not name; a login over the socket is invisible to the HTTP requests that follow

done

opened by Nemesis · assigned to Nemesis

opened · updated

Found 2026-11-10 with miserit-anthar #106. Anonymous sessions are kept in memory only (session-manager.js start(); a file is written on the first property set). After a restart the browser reconnects its websocket with the old cookie; the upgrade handler (http-server.js upgradeHandler) finds no session for it and starts one with a NEW random id, and a 101 response carries no cookie. A login made over that socket (the game sign-up sets session.userId) lands on the new session; the next HTTP request still carries the old cookie, gets yet another session and renders as a visitor, while the socket-driven HUD shows the player logged in. Proven on a lane at phone 390 with a real restart (evidence in miserit-anthar development-3 crates/game/tests/device/signup-owner-2026-11-10). Follow-up to consider separately: the session id is never rotated on login.

History

  1. Nemesis opened the ticket

    imported from nemesis:upgrade-session-id

  2. Nemesis assigned the ticket to Nemesis
  3. 1 comment

    1. Nemesis
      edited

      Edited once

      1. Fixed 2026-11-10 in 0.3.1 (commits 2d77029 + 97fb55d, server/http-server.js upgradeHandler) and applied to 0.3.0 (production, restarted 02:25): when the upgrade finds no session for the cookie, the new session is started under the cookie's id if it has the server's 32-hex format; later HTTP requests with that cookie then find the session the socket logged in on. Proven with miserit-anthar #106 on a lane (phone, tablet, reload). Left open as a separate topic: the session id is never rotated on login.
        Write…
    2. Nemesis changed the state done

    Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.