# Perspective particular page log out

**URL:** <https://forum.inductiveautomation.com/t/perspective-particular-page-log-out/78273>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [August 23, 2023, 8:34am UTC](https://forum.inductiveautomation.com/t/perspective-particular-page-log-out/78273 "2023-08-23T08:34:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [August 23, 2023, 8:34am UTC](https://forum.inductiveautomation.com/t/perspective-particular-page-log-out/78273/1 "2023-08-23T08:34:35Z")

</div>

Hello there,

Does anybody know how to log out of a particular page every 2 min?

Please let me know the approach. Thanks in advance.

Ignition version 8.1.28  
Windows 10  
Perspective Module

---

<div class="post-metadata">

**Author:** ![nicolas](https://avatars.discourse-cdn.com/v4/letter/n/67e7ee/32.png) [@nicolas](https://forum.inductiveautomation.com/u/nicolas)\
**Post date:** [August 23, 2023, 9:45am UTC](https://forum.inductiveautomation.com/t/perspective-particular-page-log-out/78273/2 "2023-08-23T09:45:22Z")

</div>

Hi, how about using an onStartup event that would start a counter / get the time / run `system.util.invokeLater()`, and then execute `system.perspective.logout()` ?

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [August 23, 2023, 9:55am UTC](https://forum.inductiveautomation.com/t/perspective-particular-page-log-out/78273/3 "2023-08-23T09:55:52Z")

</div>

> [@nicolas](#):
>
> system.util.invokeLater()

system.util.invokeLater() this function only vision scope not in perspective.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 23, 2023, 10:47am UTC](https://forum.inductiveautomation.com/t/perspective-particular-page-log-out/78273/4 "2023-08-23T10:47:25Z")

</div>

Try this:

- On the view, create `custom.viewOpenedAt`. Create an expression binding on it:  
`now(0)`.
- Create `custom.autoLogoutDelay : 120000` (120 s = 2 minutes).
- Create `custom.loginTimeout`. Create an expression binding on it:  
`(now(1000) - {view.custom.autoLogoutDelay }) > {view.custom.loginTimeout}`
- Add a change script to `custom.loginTimeout` and script the logout.

Note that `now(0)` executes once on startup of the view. `now(1000)` will update every second. My understanding is that `now()` will update at the default scan rate.

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [August 23, 2023, 11:06am UTC](https://forum.inductiveautomation.com/t/perspective-particular-page-log-out/78273/5 "2023-08-23T11:06:17Z")

</div>

Do any think missing my end,

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/3/d37f06d2d68fb7d1d88a727f69df258adcd95054.png)

**for viewOpenedAt:**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/c/3ce86a27d8d1981cc7a00f09c2794a128c869559.png)

**for loginTimeout:**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/d/dd28c89e19d3843841e9939fadc4f16933835b74.png)

**for loginTimeout change script:**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/d/7d9017043a4d25955733bdef375c07f77928db16.png)

---

<div class="post-metadata">

**Author:** ![Learner\_Ignition](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Learner\_Ignition](https://forum.inductiveautomation.com/u/Learner_Ignition)\
**Post date:** [August 23, 2023, 12:11pm UTC](https://forum.inductiveautomation.com/t/perspective-particular-page-log-out/78273/6 "2023-08-23T12:11:39Z")

</div>

I had followed @Transistor and made below changes .

1. On View event Startup script  
`self.view.custom.viewOpenedAt = system.date.now()`

2. removed the now(0) binding from viewOpenedAt

3. 

> [@Transistor](#):
>
> (now(1000) - {view.custom.autoLogoutDelay }) \> {view.custom.loginTimeout}

Change it to `(now(1000) - {view.custom.autoLogoutDelay}) > {view.custom.viewOpenedAt}`
