Repair Server-Side Session Authentication and code structure refactoring.

Job ID: 40334693

Budget: €30 – €250 EUR

My browser-based idle game runs on a Java back end with a TypeScript front end, but the code is tangled and the authentication layer is falling apart. Players can sign in, yet their session disappears the moment they refresh or open a new tab. I need server-side sessions that hold steady so progress is never lost and exploits stay closed.

Here’s what I’m after:
• Review the current mixed codebase, pinpoint why sessions vanish and cleanly separate auth logic where necessary.
• Implement reliable server-side session handling—no cookies or local-storage work-arounds—complete with sensible expiry and renewal.
• Ensure the front end automatically re-attaches the session token on every request and blocks unauthenticated calls with a clear JSON error.
• Deliver clear, commented code plus a short README explaining the new flow and any endpoints you added or altered.

Acceptance passes when a player remains logged in across reloads and tab changes until logout or timeout, and I can merge your branch into staging without breaking existing gameplay.