# How to add application timeout script in perspective?

**URL:** <https://forum.inductiveautomation.com/t/how-to-add-application-timeout-script-in-perspective/61501>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 5, 2022, 7:25am UTC](https://forum.inductiveautomation.com/t/how-to-add-application-timeout-script-in-perspective/61501 "2022-07-05T07:25:15Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![Ahad\_Imtiaz](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Ahad\_Imtiaz](https://forum.inductiveautomation.com/u/Ahad_Imtiaz)\
**Post date:** [July 6, 2022, 1:10pm UTC](https://forum.inductiveautomation.com/t/how-to-add-application-timeout-script-in-perspective/61501/17 "2022-07-06T13:10:24Z")

</div>

@Transistor @schenk @victordcq

Thank you all for the support.

The script and the logout action are now working fine!

These are the steps that I have followed:

1. I created two session props ‘idletime’ and ‘timeout’.
2. Created an integer memory tag with the name ‘idletime’ and bind it with numeric entry perspective component.
3. Binded the session property ‘timeout’ with the ‘idletime tag’
4. Expression binding on ‘idletime’ session prop:

```auto
now(1000) - {session.props.lastActivity} > {this.custom.timeout}

```

and in change property script:

```auto
   if currentValue.value == True:
      system.perspective.closeSession()
   else:
      return currentValue

```

1. Entering time in milliseconds in numeric entry. When lapsed seconds \> user input seconds then the session is closed and user need to login to view the page again.

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-add-application-timeout-script-in-perspective/61501)._
