# Is it possible to limit the lifetime of a ThinLinc session?

**URL:** <https://community.thinlinc.com/t/is-it-possible-to-limit-the-lifetime-of-a-thinlinc-session/951>\
**Category:** Knowledge Base\
**Created:** [25 May 2024 06:12 UTC](https://community.thinlinc.com/t/is-it-possible-to-limit-the-lifetime-of-a-thinlinc-session/951 "2024-05-25T06:12:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaron](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/aaron/32/13_2.png) [@aaron](https://community.thinlinc.com/u/aaron)\
**Post date:** [25 May 2024 06:12 UTC](https://community.thinlinc.com/t/is-it-possible-to-limit-the-lifetime-of-a-thinlinc-session/951/1 "2024-05-25T06:12:44Z")

</div>

One benefit of terminal server solutions like ThinLinc is the ability to have persistent sessions. Users can log in, start a job, disconnect at any time, and come back later to pick up where they left off. This is especially useful for long-running, non-interactive jobs which don’t require constant supervision.

However, session persistence is not always desirable. Sometimes users might finish their job, but rather than logging out afterwards, they simply disconnect from their ThinLinc session. This leaves the session running on the server, unnecessarily consuming ThinLinc licenses and potentially system resources as well. While it may be convenient to keep the session alive for short periods of time - for example, to allow users to move locations or stop work for the weekend - leaving unused sessions running for weeks or months can be wasteful.

Administrators can configure ThinLinc to terminate sessions automatically when certain conditions are met, such as no client being connected for a certain period of time. You can find a list of available options and how to set them in the ThinLinc Administrator’s Guide here:

[https://www.cendio.com/resources/docs/tag/config\_lifetime.html#configuration-limiting-lifetime](https://www.cendio.com/resources/docs/tag/config_lifetime.html#configuration-limiting-lifetime)

When setting these options make sure to put user experience first; nobody wants to have their session terminated halfway through a job. But setting them appropriately for your specific use-case can make your systems more efficient and maximise resource usage within your organisation.

---

<div class="post-metadata">

**Author:** ![CHerman](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@CHerman](https://community.thinlinc.com/u/CHerman)\
**Post date:** [13 December 2024 14:13 UTC](https://community.thinlinc.com/t/is-it-possible-to-limit-the-lifetime-of-a-thinlinc-session/951/2 "2024-12-13T14:13:17Z")

</div>

Hi,

Does the lifetime parameters apply to the _Web Accesss_ solution?  
I failed to close user session when using _Web Access_ in combination with _-MaxDisconnectionTime_.  
Any suggestions?

I need to close the user session when the client disconnects without logout from Desktop.  
We use tablets (therefor using Web Access) and the user disconnect/lose the network connection without further notice.

---

<div class="post-metadata">

**Author:** ![aaron](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/aaron/32/13_2.png) [@aaron](https://community.thinlinc.com/u/aaron)\
**Post date:** [2 January 2025 04:02 UTC](https://community.thinlinc.com/t/is-it-possible-to-limit-the-lifetime-of-a-thinlinc-session/951/3 "2025-01-02T04:02:57Z")

</div>

Hi @CHerman,

I’ve just tested `MaxDissconnectionTime` using both the native and browser-based clients, and it seems to work for me in both cases. When using web access, I closed the tab with the ThinLinc session in it.

If your users are just switching away from the browser app on their tablets, it may not register a disconnect. The `MaxIdleTime` switch may be useful if this is the case:

> **[Limiting lifetime of ThinLinc sessions — ThinLinc Administrator's Guide](https://www.cendio.com/resources/docs/tag/config_lifetime.html#cmdoption-MaxIdleTime)**
>
> Learn how to control and limit the lifetime of ThinLinc sessions using Xserver options such as MaxDisconnectionTime, MaxConnectionTime, and MaxIdleTime to manage session duration and idle behavior.

Hope that helps.

---

<div class="post-metadata">

**Author:** ![samuel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/samuel/32/335_2.png) [@samuel](https://community.thinlinc.com/u/samuel)\
**Post date:** [3 January 2025 13:20 UTC](https://community.thinlinc.com/t/is-it-possible-to-limit-the-lifetime-of-a-thinlinc-session/951/4 "2025-01-03T13:20:40Z")

</div>

Note that changing options like `/vsmagent/xserver_args` to add `MaxDisconnectionTime` or `MaxIdleTime` both require a restart of **vsmagent** and only affect new sessions, not existing ones.

---

<div class="post-metadata">

**Author:** ![CHerman](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@CHerman](https://community.thinlinc.com/u/CHerman)\
**Post date:** [7 January 2025 06:18 UTC](https://community.thinlinc.com/t/is-it-possible-to-limit-the-lifetime-of-a-thinlinc-session/951/5 "2025-01-07T06:18:16Z")

</div>

> [@aaron](#):
>
> If your users are just switching away from the browser app on their tablets, it may not register a disconnect.

They disconnect the tablet without closing the browser 🙂  
I hoped there were some sort of heartbeat/keepalive that would detect this faulty handling.

Thanks for your response.
