Closed illcrx closed 7 years ago
You can just delete a property from the session, and that will send an updated cookie header.
However, I'd like to advise that depending on the size of this mongo document, it may not be wise to be sending it in a Set-Cookie
header. The client will be resubmitting the entire document to the server with every request, and every time you make a tiny change in that document, the server will resend the entrire thing in a new Set-Cookie
header.
Fair assessment I could just send what I need then, thanks!
When a user makes a request I am going to store the whole mongo document on their browser, then recall that upon the next request they send back to use if I need to. However I dont want to overload the browser. Is there a way to delete data after a request is sent to the server without deleting all of the session data? From the docs it looks like the session has to be timed, however I cannot tell if a user is going to be on the same page for a few seconds or days.