# Limit Current Session Perspective

**URL:** <https://forum.inductiveautomation.com/t/limit-current-session-perspective/74227>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 26, 2023, 3:44pm UTC](https://forum.inductiveautomation.com/t/limit-current-session-perspective/74227 "2023-05-26T15:44:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Noyola](https://avatars.discourse-cdn.com/v4/letter/f/bc8723/32.png) [@Fernando\_Noyola](https://forum.inductiveautomation.com/u/Fernando_Noyola)\
**Post date:** [May 26, 2023, 3:44pm UTC](https://forum.inductiveautomation.com/t/limit-current-session-perspective/74227/1 "2023-05-26T15:44:33Z")

</div>

Hello! Where or how can I limit the Max Current Session in Perspective per user. For example in my Project I have an user called: "Admin" and I want to have only 1 session open.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [May 26, 2023, 3:53pm UTC](https://forum.inductiveautomation.com/t/limit-current-session-perspective/74227/2 "2023-05-26T15:53:33Z")

</div>

Review the suggestions in this thread  
[Limit Perspective Sessions/Pages - Ignition - Inductive Automation Forum](https://forum.inductiveautomation.com/t/limit-perspective-sessions-pages/67888/6)

---

<div class="post-metadata">

**Author:** ![Fernando\_Noyola](https://avatars.discourse-cdn.com/v4/letter/f/bc8723/32.png) [@Fernando\_Noyola](https://forum.inductiveautomation.com/u/Fernando_Noyola)\
**Post date:** [May 26, 2023, 4:01pm UTC](https://forum.inductiveautomation.com/t/limit-current-session-perspective/74227/3 "2023-05-26T16:01:24Z")

</div>

Thanks for what I understood is in the SessionEvent but I dont understand very well where I need to put the script and how the script should be written, I´m not good at programation 😅

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [May 26, 2023, 4:12pm UTC](https://forum.inductiveautomation.com/t/limit-current-session-perspective/74227/4 "2023-05-26T16:12:39Z")

</div>

You'll start in `Perspective -> Session Events -> Startup` from the project browser in the designer. This is untested, but it could look like this

```auto
sessionInfo = system.perspective.getSessionInfo(projectFilter="Admin Project")
for sessionObj in sessionInfo:
	if sessionObj["username"] == "Admin":
		system.perspective.closeSession("Only one session is allowed")

```

[system.perspective.getSessionInfo - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/system.perspective.getSessionInfo)  
[system.perspective.closeSession - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/system.perspective.closeSession)

---

<div class="post-metadata">

**Author:** ![Fernando\_Noyola](https://avatars.discourse-cdn.com/v4/letter/f/bc8723/32.png) [@Fernando\_Noyola](https://forum.inductiveautomation.com/u/Fernando_Noyola)\
**Post date:** [May 26, 2023, 4:16pm UTC](https://forum.inductiveautomation.com/t/limit-current-session-perspective/74227/5 "2023-05-26T16:16:27Z")

</div>

Thanks! Worked perfectly
