# Session.props userName

**URL:** <https://forum.inductiveautomation.com/t/session-props-username/109686>\
**Category:** Ignition\
**Created:** [August 13, 2025, 11:56am UTC](https://forum.inductiveautomation.com/t/session-props-username/109686 "2025-08-13T11:56:38Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_McHale](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Thomas\_McHale](https://forum.inductiveautomation.com/u/Thomas_McHale)\
**Post date:** [August 13, 2025, 11:56am UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/1 "2025-08-13T11:56:38Z")

</div>

I need to turn on a bit when a user is logged into the system session.props.auth.user.userName. I can get it work in my dashboard but not sure how to get a tag to 1/0 to turn on a bit in my plc to prevent machine from running without an operator being logged into the system.

---

<div class="post-metadata">

**Author:** ![andrew.budaiev](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrew.budaiev/32/72921_2.png) [@andrew.budaiev](https://forum.inductiveautomation.com/u/andrew.budaiev)\
**Post date:** [August 13, 2025, 11:59am UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/2 "2025-08-13T11:59:30Z")

</div>

You need to look into [isAuthorized | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/users/isAuthorized)

---

<div class="post-metadata">

**Author:** ![Thomas\_McHale](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Thomas\_McHale](https://forum.inductiveautomation.com/u/Thomas_McHale)\
**Post date:** [August 13, 2025, 12:15pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/3 "2025-08-13T12:15:05Z")

</div>

thanks i read that over prior but not the best some of this stuff, i created a expression tag Boolean and used isAuthorized(true) i get error configuration

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [August 13, 2025, 12:17pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/4 "2025-08-13T12:17:14Z")

</div>

Is there any chance that multiple operators might be logged in at the same time? What should happen in that case?

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [August 13, 2025, 12:19pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/5 "2025-08-13T12:19:27Z")

</div>

> [@Thomas\_McHale](#):
>
> created a expression tag Boolean and used isAuthorized(true) i get error configuration

Note that this expression does not work everywhere (from link above):

> Scope is Perspective Sessions only.

---

<div class="post-metadata">

**Author:** ![Thomas\_McHale](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Thomas\_McHale](https://forum.inductiveautomation.com/u/Thomas_McHale)\
**Post date:** [August 13, 2025, 12:21pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/6 "2025-08-13T12:21:14Z")

</div>

no just one

---

<div class="post-metadata">

**Author:** ![Thomas\_McHale](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Thomas\_McHale](https://forum.inductiveautomation.com/u/Thomas_McHale)\
**Post date:** [August 13, 2025, 12:23pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/7 "2025-08-13T12:23:56Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/2/52053fd905aa3eb5789a734c71ef7ba5ff115e16.png)

now need my tag to display this 1 ir 0

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 13, 2025, 12:26pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/8 "2025-08-13T12:26:09Z")

</div>

You should not try to do this in the session. Instead, use a gateway timer event that calls [system.perspective.getSessionInfo()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-getSessionInfo) every ten seconds, or minute, or whatever you need. The script would loop through the results to check for the desired status, perhaps ignoring designer sessions, and writing `True` to the target tag if a suitable session is found. (And returning early.) Write `False` if no qualifying session is found.

(I'd include a check of `lastComm` in your logic, to catch crashed browsers or abrupt shutdowns as early as practical.)

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [August 13, 2025, 12:35pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/9 "2025-08-13T12:35:31Z")

</div>

Unsure if this option fits your mold - I would build security level rules which are tied to appropriately authenticated users, and ensure that all appropriate writes (start, hand/auto, etc) to the PLC are with from authenticated operators only (using tag security). Animation (to disable/enable a button or setpoint entry) can be tied to the `.CanWrite` property on a tag, which is unique to each user of the project.

---

<div class="post-metadata">

**Author:** ![Thomas\_McHale](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Thomas\_McHale](https://forum.inductiveautomation.com/u/Thomas_McHale)\
**Post date:** [August 13, 2025, 12:48pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/10 "2025-08-13T12:48:57Z")

</div>

> [@pturmel](#):
>
> You should not try to do this in the session. Instead, use a gateway timer event that calls [system.perspective.getSessionInfo()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-getSessionInfo) every ten seconds, or minute, or whatever you need. The script would loop through the results to check for the desired status, perhaps ignoring designer sessions, and writing `True` to the target tag if a suitable session is found. (And returning early.) Write `False` if no qualifying session is found.
> 
> (I'd include a check of `lastComm` in your logic, to catch crashed browsers or abrupt shutdowns as early as practical.)

yes have users and levels set and controlling access to params and etc. just need a bit to tell me they are logged into the system.

---

<div class="post-metadata">

**Author:** ![Thomas\_McHale](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Thomas\_McHale](https://forum.inductiveautomation.com/u/Thomas_McHale)\
**Post date:** [August 13, 2025, 12:49pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/11 "2025-08-13T12:49:31Z")

</div>

yes have users and levels set and controlling access to params and etc. just need a bit to tell me they are logged into the system.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 13, 2025, 12:51pm UTC](https://forum.inductiveautomation.com/t/session-props-username/109686/12 "2025-08-13T12:51:20Z")

</div>

> [@Thomas\_McHale](#):
>
> just need a bit to tell me they are logged into the system.

Yes, use a gateway timer event that writes the bit based on the sessions present. 🤷‍♂️
