I have an express middleware that reads a query param and sets a "flag" in request headers if it's present. I want to use the presence of this flag in other middlewares which handle setting cookies.
However, passing the query param from the browser only sets it in that particular request. When loading the page, there are several other requests from other sources to load content, and they don't include that header, so the other middlewares end up firing (which I don't want).
What are some appropriate ways to solve this problem? I essentially need my "flag" to persist across requests, besides using session.