
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to close session app which created by "createSessionAppFromApp" from enigma.js
I found there are some session apps which created by "createSessionAppFromApp" from enigma.js, in memory.
So I think I didn't close or destroy the session apps correctly. I want to know how to close session app from enigma.js.
Currently I am just using session.close() to close the session rather than close the session app.
Refer code:
const global = await enigma.create(enigmaConfig).open()
const app = await global.createSessionAppFromApp(appId)
/** Do something for this session app, then close the session */
global.session.close()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@sophie2021 wrote:
I found there are some session apps which created by "createSessionAppFromApp" from enigma.js, in memory.
So I think I didn't close or destroy the session apps correctly. I want to know how to close session app from enigma.js.
Currently I am just using session.close() to close the session rather than close the session app.
Refer code:
const global = await enigma.create(enigmaConfig).open()
const app = await global.createSessionAppFromApp(appId)
/** Do something for this session app, then close the session */
global.session.close()
Hello @sophie2021,
To properly close a session app in enigma.js, you should close the session itself rather than just the session app. Here's an updated version of your code:
const global = await enigma.create(enigmaConfig).open();
const app = await global.createSessionAppFromApp(appId);
/** Do something for this session app, then close the session */
await global.close();
This ensures that both the session and the session app are properly closed.
Best regards,
Jennifer Block


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Session apps get closed (and deleted) along with the session. This will happen when there are no more connections to the session and the session TTL of 120 seconds has passed. So closing the session like you do is sufficient.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Forgot to ask if this was QCS or Client Managed by the way. In Client Managed the TTL is 0 seconds unless you have configured it otherwise, so there the session gets deleted immediately.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i just tried global.close()
It showed errore: TypeError: global.close is not a function
