OpenVidu Session Persistance

Will a session created on openvidu stay open permanently so long as .close() is not called on it?

For example:

A user creates a Meeting in my webapp

  • I create my Meeting object and at that time I ping my openvidu instance to create a session with a custom session_id.
  • I store session_id on my meeting object, and use it for creating tokens and other purposes.

Even if a long time passes, I do not need to worry about losing the session object on my openvidu server until I explicitely call session.close() on the matching Meeting’s session_id?

The session will be automatically closed when the last participant disconnects, bare that in mind. If you want to overcome this, you must manage the possibility of having to re-create again your “customSessionId” session. Will be a different one, but just with the same identifier.

Thanks for the clarification, Pablo. If I am creating the session programmatically like this, I will not have added any participants yet.

Does this mean that so long as no participants are added, the session will remain open indefinitely. But once one is added and then removed by any means, it will close?

I see now there is information on the session lifecycle in this thread:

Added an issue to enhance docs on this.