In JS, say I have an app 'A' running on port 2000 and a different app 'B' running on 3000 that I would like to share a single variable between, i.e. something happens on app A and sets a var that app B can access.
Since this needs to persist (at least in the current session), I was thinking I could do this by setting session data in app A and then sharing/cloning that session data to app B, but is that possible? Even if I need to share the data across all sessions in the current window that's fine for my case, but given that these are apps occurring in different sessions, I'm not sure if sharing data between them like so can be done.
I'm aware I could also use a database to store the var and read it in, but I was curious if I could do this in just using the browser/window/JS. If my session idea doesn't make any sense or is impossible, how else might it be recommended I go about this? Thanks!