# Automatic Inactivity Detection possibilities

**URL:** <https://forum.inductiveautomation.com/t/automatic-inactivity-detection-possibilities/72756>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 21, 2023, 1:12pm UTC](https://forum.inductiveautomation.com/t/automatic-inactivity-detection-possibilities/72756 "2023-04-21T13:12:07Z")\
**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:** [April 21, 2023, 2:34pm UTC](https://forum.inductiveautomation.com/t/automatic-inactivity-detection-possibilities/72756/2 "2023-04-21T14:34:30Z")

</div>

You can set up a script using the [`lastActivity` session prop](https://forum.inductiveautomation.com/t/perspective-run-script-after-inactivity-timer-elapses/43865/10) (I'd probably use a property bound to the current date, updating once per minute, with a change script like in [this post](https://forum.inductiveautomation.com/t/perspective-run-script-after-inactivity-timer-elapses/43865/6)) and then ~~call the [`system.security.switchUser()`](https://docs.inductiveautomation.com/display/DOC81/system.security.switchUser) function to switch to some "guest" user, since it seems like the `logout` function takes you to the login page again.~~

 

~~You could probably also have a script that automatically logs the user in to the "guest" user on session start, and hijack the logout button to switch user to your "guest" instead.~~ never mind, can't do that in Perspective

Maybe someone else has a ~~less complicated solution~~ solution that actually works though.

---

_[View the full topic](https://forum.inductiveautomation.com/t/automatic-inactivity-detection-possibilities/72756)._
