# How can we logout when user closes the tab o browser?

**URL:** <https://forum.inductiveautomation.com/t/how-can-we-logout-when-user-closes-the-tab-o-browser/70728>\
**Category:** Ignition\
**Created:** [March 7, 2023, 1:42pm UTC](https://forum.inductiveautomation.com/t/how-can-we-logout-when-user-closes-the-tab-o-browser/70728 "2023-03-07T13:42:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julio\_Varela](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Julio\_Varela](https://forum.inductiveautomation.com/u/Julio_Varela)\
**Post date:** [March 7, 2023, 1:42pm UTC](https://forum.inductiveautomation.com/t/how-can-we-logout-when-user-closes-the-tab-o-browser/70728/1 "2023-03-07T13:42:04Z")

</div>

Hi

When I close the page and go back in, you're still logged in.  
Is there a way to log out when you close the page?  
If so, what would the event be?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 7, 2023, 4:49pm UTC](https://forum.inductiveautomation.com/t/how-can-we-logout-when-user-closes-the-tab-o-browser/70728/2 "2023-03-07T16:49:40Z")

</div>

Browsers don't supply tab closure events. (They used to, but spammers would use them to open popups and do other bad things, so, nope, not allowed.)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 7, 2023, 5:00pm UTC](https://forum.inductiveautomation.com/t/how-can-we-logout-when-user-closes-the-tab-o-browser/70728/3 "2023-03-07T17:00:06Z")

</div>

What you end up with is a Session timeout event in Perspective, and the timeout duration should also be configurable.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 7, 2023, 5:37pm UTC](https://forum.inductiveautomation.com/t/how-can-we-logout-when-user-closes-the-tab-o-browser/70728/4 "2023-03-07T17:37:47Z")

</div>

@Julio_Varela [Perspective Session Event Scripts - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Perspective+Session+Event+Scripts#PerspectiveSessionEventScripts-StartupandShutdownEventScripts)
