# Limit Perspective Session to single browser tab

**URL:** <https://forum.inductiveautomation.com/t/limit-perspective-session-to-single-browser-tab/39663>\
**Category:** Ignition\
**Created:** [October 14, 2020, 3:09pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-session-to-single-browser-tab/39663 "2020-10-14T15:09:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [October 14, 2020, 3:09pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-session-to-single-browser-tab/39663/1 "2020-10-14T15:09:47Z")

</div>

@paul-griffith @cmallonee Is there a way to limit a Perspective session to a single browser tab?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 14, 2020, 3:51pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-session-to-single-browser-tab/39663/2 "2020-10-14T15:51:23Z")

</div>

You can’t prevent them from opening a new tab to the project, but you can use the Page OnStartup Event to immediately send the new tab to a non-op page. Something like this in the Page OnStartup Event:

```auto
for session in system.perspective.getSessionInfo(projectFilter="MyProject"):
    if session.id == page.session.props.id:
        if session.activePages > 1:
            system.perspective.closePage(pageId=page.props.pageId)

```

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [October 14, 2020, 4:09pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-session-to-single-browser-tab/39663/3 "2020-10-14T16:09:53Z")

</div>

Thank you. I am running 8.0.16 and the Page Startup event option is not available:

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

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 14, 2020, 4:18pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-session-to-single-browser-tab/39663/4 "2020-10-14T16:18:03Z")

</div>

You could manage the same functionality by registering the first page opened for a session in a custom session property, and then using a Gateway timer script to occasionally ping sessions and if the session has more than one page open you close any pages which don’t have the stored pageId.

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [October 14, 2020, 4:19pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-session-to-single-browser-tab/39663/5 "2020-10-14T16:19:51Z")

</div>

Do you know when the Page Startup event will become available? The manual says version 8.0.16 but obviously that is not correct.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 14, 2020, 4:25pm UTC](https://forum.inductiveautomation.com/t/limit-perspective-session-to-single-browser-tab/39663/6 "2020-10-14T16:25:36Z")

</div>

8.1.0. I’ll reach out to the documentation team to update the docs. I do remember that some documentation had been put in place because there was a mis-communication as to when that would be released - apparently we didn’t update everything.
