boxlang-express 0.1.17
Released .
- Fix:
boxExpressSession()persistedreq.sessionto the store beforenext()ran, not after — so anything the request chain mutated on it (boxExpressCsrf()minting a token, a login handler setting the user, etc.) was written to local memory only and never made it back to the store. Invisible against the default in-memoryMemoryStore, since structs are pass-by-reference — that earlystore.set()call was really just inserting a reference into aConcurrentHashMap, and any later mutation of the same object was automatically visible through it. A real out-of-process store has to serialize on write (aboxExpressCacheStore()-backedJDBCStore, Redis, etc.), which breaks that accidental reference-sharing and exposes the bug for real: a CSRF token minted mid-request never gets saved, so the very next request — even the form submission that follows the page that minted it — reads back a session with no token and403s. Now persists afternext(), wrapped intry/finallyso a throw partway through the chain still saves whateverreq.sessionheld at that point;req.destroySession()skips that save so a destroyed session isn't silently resurrected by it. See Session.bx.