# Access Session parameters

**URL:** <https://forum.inductiveautomation.com/t/access-session-parameters/84844>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [January 27, 2024, 1:04pm UTC](https://forum.inductiveautomation.com/t/access-session-parameters/84844 "2024-01-27T13:04:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vatsal\_Shah](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@Vatsal\_Shah](https://forum.inductiveautomation.com/u/Vatsal_Shah)\
**Post date:** [January 27, 2024, 1:04pm UTC](https://forum.inductiveautomation.com/t/access-session-parameters/84844/1 "2024-01-27T13:04:05Z")

</div>

Is there any way where we can access session parameters in Session Event Scripts or in Gateway Event Scripts ?

---

<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:** [January 27, 2024, 2:19pm UTC](https://forum.inductiveautomation.com/t/access-session-parameters/84844/2 "2024-01-27T14:19:01Z")

</div>

> ... where we can access session ~~parameters~~ **properties** in Session Event scripts ...

`page.session.custom.mySessionProp = system.date.now()`

> ... or in Gateway Event Scripts?

No. The gateway events know nothing about what sessions are running - if any.

---

<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:** [January 27, 2024, 3:22pm UTC](https://forum.inductiveautomation.com/t/access-session-parameters/84844/3 "2024-01-27T15:22:25Z")

</div>

Session event scripts have access to session properties, except for session startup, which has partial access. (It runs very early in the "life" of a session.)

Gateway events can send messages to Perspective sessions, where a session message handler would have access to the session properties.

---

<div class="post-metadata">

**Author:** ![Vatsal\_Shah](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@Vatsal\_Shah](https://forum.inductiveautomation.com/u/Vatsal_Shah)\
**Post date:** [January 27, 2024, 3:51pm UTC](https://forum.inductiveautomation.com/t/access-session-parameters/84844/4 "2024-01-27T15:51:00Z")

</div>

Can we do this with session startup event ?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/6/56b2b35654f2e309b75cc199a5ef9127cefc03b5.png)  
I tried this but it's not working

---

<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:** [January 27, 2024, 4:03pm UTC](https://forum.inductiveautomation.com/t/access-session-parameters/84844/5 "2024-01-27T16:03:11Z")

</div>

That script is not what I suggested in post #2.

---

<div class="post-metadata">

**Author:** ![Vatsal\_Shah](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@Vatsal\_Shah](https://forum.inductiveautomation.com/u/Vatsal_Shah)\
**Post date:** [January 27, 2024, 4:21pm UTC](https://forum.inductiveautomation.com/t/access-session-parameters/84844/6 "2024-01-27T16:21:17Z")

</div>

The way you suggested earlier is working but was wondering is this thing can be achieved with Session Startup script as well

---

<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:** [January 27, 2024, 4:27pm UTC](https://forum.inductiveautomation.com/t/access-session-parameters/84844/7 "2024-01-27T16:27:19Z")

</div>

Place an expression binding on that session property to `now(0)` instead of using a script. The zero in `now()` causes it to only execute once, which will be very soon after session startup.
