I'm using cookies to set values in an array.
req.cookie.array = []; // At first request
Then like so:
req.cookie.array.push('valueX');
Unfortunately, I'm sending my requests asynchronously, so whichever request goes back to the server the quickest ends up being overwritten by the later ones. How do I keep them synchronized?
I can't change the request method as I'm using FilePond. Is there any other way to prevent this?
FilePond is basically sending a file one by one, and I am saving the name of the file on the server in an array.
FilPond.File1 + Cookie ===> Server [save filename in cookie] ======> Cookie Saved in Client
FilPond.File2 + Cookie =====> Server [save filename in cookie] ===> Cookie Saved in Client
In the end the cookie should have two values in the array, but it only has one, because the cookie wasn't received by the client before the next request was sent.