John Murray also provided a different solution in this post. You can view globals by database rather than namespace in the SMP. That way you can export a global from one database into a file, then import it into another database. After some digging I found this is actually what the documentation recommends. The advantage of the MERGE is that it's much simpler to do programmatically. I can't speak to the difference in performance.

Hi Ashok,

It looks like the %session variable isn't accessible in a zen background method. I'd suggest passing the %session.SessionId as an argument into the background method. You can store the JSON data in a global or a persistent class keyed by the session id, and access it from there. Then you can override the OnEndSession() method of the application's event class to delete the data when the session is over: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...