# Session Length Limit?

**URL:** <https://openvidu.discourse.group/t/session-length-limit/1694>\
**Category:** Issues with deployment\
**Tags:** v2\
**Created:** [August 1, 2020, 6:15pm UTC](https://openvidu.discourse.group/t/session-length-limit/1694 "2020-08-01T18:15:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcdmacleod](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/jcdmacleod/32/149_2.png) [@jcdmacleod](https://openvidu.discourse.group/u/jcdmacleod)\
**Post date:** [August 1, 2020, 6:15pm UTC](https://openvidu.discourse.group/t/session-length-limit/1694/1 "2020-08-01T18:15:48Z")

</div>

We have an issue where some people do not close their session. Is there a way we can implement a max session limit or perhaps just schedule a restart of the OV instance at midnight? Any suggestions?

---

<div class="post-metadata">

**Author:** ![vipin\_mishra](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/vipin_mishra/32/32_2.png) [@vipin\_mishra](https://openvidu.discourse.group/u/vipin_mishra)\
**Post date:** [August 1, 2020, 7:04pm UTC](https://openvidu.discourse.group/t/session-length-limit/1694/2 "2020-08-01T19:04:42Z")

</div>

i am confused are you talking about sessions duration limits or anything else.  
Thanks

---

<div class="post-metadata">

**Author:** ![jcdmacleod](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/jcdmacleod/32/149_2.png) [@jcdmacleod](https://openvidu.discourse.group/u/jcdmacleod)\
**Post date:** [August 1, 2020, 7:46pm UTC](https://openvidu.discourse.group/t/session-length-limit/1694/3 "2020-08-01T19:46:26Z")

</div>

Yes, similar to max call duration in a VOIP application. We’d like to set something like a max session duration of 240 minutes.

---

<div class="post-metadata">

**Author:** ![vipin\_mishra](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/vipin_mishra/32/32_2.png) [@vipin\_mishra](https://openvidu.discourse.group/u/vipin_mishra)\
**Post date:** [August 1, 2020, 8:27pm UTC](https://openvidu.discourse.group/t/session-length-limit/1694/4 "2020-08-01T20:27:31Z")

</div>

currently its not in openvidu but i think you have do it yourself by triggering a function by storing all session creation time .And run trigger after creation time + your duration for remove the session.Its more nice so can also trace everyuser duration.  
Thanks

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [August 3, 2020, 9:01am UTC](https://openvidu.discourse.group/t/session-length-limit/1694/5 "2020-08-03T09:01:54Z")

</div>

Yes, that’s right. There’s not a “built-in” max-session duration feature, but you can of course control it yourself and close the session in your application’s backend once the time limit is reached.

---

<div class="post-metadata">

**Author:** ![msalomon](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/msalomon/32/484_2.png) [@msalomon](https://openvidu.discourse.group/u/msalomon)\
**Post date:** [August 6, 2020, 7:27pm UTC](https://openvidu.discourse.group/t/session-length-limit/1694/6 "2020-08-06T19:27:52Z")

</div>

Sorry, but I don’t know why do you need that. I mean, if they are over 4 hours in a meeting, what’s the problem? if there is users connected to the session the session will keep open, and I think that’s right. But, if nobody is connected to the session for a while (less than 5 minutes) the session will be closed by the server.

BTW, there is a createdAt in the session object, so you can use it to close after X time, but, again, I don’t know why do you need to do that.
