# Perspective Session Cleanup

**URL:** <https://forum.inductiveautomation.com/t/perspective-session-cleanup/87402>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 15, 2024, 1:47pm UTC](https://forum.inductiveautomation.com/t/perspective-session-cleanup/87402 "2024-03-15T13:47:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [March 15, 2024, 2:02pm UTC](https://forum.inductiveautomation.com/t/perspective-session-cleanup/87402/2 "2024-03-15T14:02:00Z")

</div>

Perspective session messages are sent from the gateway (any script that could send one has to run on the gateway in Perspective) so it wouldn't work as a heartbeat to detect browser connection loss.

The session shutdown event does eventually detect disconnection, but it takes time:

> [@Understanding perspective session events](https://forum.inductiveautomation.com/t/understanding-perspective-session-events/23328/3):
>
> Closing a browser window doesn’t kill your session - it remains alive for 120 (maybe 60?) seconds by default, which can be configured here, in the Session Timeout section: So you won’t see the “end\_session” message sent from the Perspective Session for at least one minute, maybe two. I’ll look into the device\_id being empty, but I just tested it myself and it worked as expected…

More discussion on the topic, including a link to a relevant feature request:

> [@Detecting lost connection to the gateway](https://forum.inductiveautomation.com/t/detecting-lost-connection-to-the-gateway/78502):
>
> We are testing how perspective clients react to a communication loss to the gateway due to a cable break or the gateway loosing power. We observe that it takes 2,5 minutes before the client displays the "No Connection to Gateway" banner. [image] Looking into the browser console, we see that after approximately 2 minutes and 15 seconds we get the message store.Channel: Disconnecting websocket with message: "Idle time reached." After 15 more seconds we get the message store.Channel: Websocket c…

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-session-cleanup/87402)._
