You can use either of the methods #targetengine or insertLabel.
One demerit, I would say, of #targetengine "session01" is that the specific session will exists as long as InDesign is running, which is not desirable. Those will destroy only when you quit your application. I don't think there is any garbage collection to rescue here.
However, insertLabel and extractLabel can be used on specifc DOM objects, as per your need, including the app object.
If you want to share variables across scripts on per-document basis then you can store the variables on the document object:
doc.insertLabel("name", "value");
So, once the document is closed all the labels are gone. You can decide according to your requirement whether you want application-level globals (then use app.insertLabel), document level (then doc.insertLabel), spread level, etc.