fastify-session icon indicating copy to clipboard operation
fastify-session copied to clipboard

Multiple overlapping requests cause session data to be lost

Open johnspackman opened this issue 3 years ago • 0 comments

If multiple requests arrive at the same time (eg XHR), then the session data is loaded from the store at the start of each request and then saved; however, this means that the request.session object is a duplicate for each request, and therefore the two different requests will make independent changes. When the session data is stored at the end of each request, whatever changes were in the first store will be overwritten by the second.

johnspackman avatar Mar 29 '22 09:03 johnspackman