# Session Properties

**URL:** <https://forum.inductiveautomation.com/t/session-properties/81993>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 16, 2023, 3:29pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993 "2023-11-16T15:29:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [November 16, 2023, 3:29pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/1 "2023-11-16T15:29:47Z")

</div>

I need to display different table data on 3 different machines. I would like to be able to do this respective to a specific IP address that is mapped to each machine. Is this something that is possible to do with session properties?

---

<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:** [November 16, 2023, 3:50pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/2 "2023-11-16T15:50:28Z")

</div>

Are you asking, "Can I have the gateway detect the Perspective client's IP address and serve a specific view related to that IP address?".

If so, the answer is usually "No".

> [@Perspective - Scripting - Get Computer name and IP of client](https://forum.inductiveautomation.com/t/perspective-scripting-get-computer-name-and-ip-of-client/49626/11):
>
> Keep in mind that this operation works on the IP address of the TCP (http) connection to the server from the Server’s perspective. Clients behind a NAT firewall will be seen as the firewall’s IP, and with the name of the firewall via reverse DNS. Users familiar with Vision’s total access to the local computer will forever be disappointed at the lack of access via browsers.

> [@How to get the device/host Name on client server](https://forum.inductiveautomation.com/t/how-to-get-the-device-host-name-on-client-server/59046/1):
>
> Hi all, The script system.net.getHostName() returns the host/device name in local device and in client server it was returning the server name but instead of server name is their any chance to get the device name in the server side too. Do we have any inbuilt-function or script to get this requirement. please suggest something to solve this. Thanks

---

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [November 16, 2023, 3:53pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/3 "2023-11-16T15:53:54Z")

</div>

Yes, I was wanting to have the gateway detect the Perspective client's IP address and serve a specific view related to that IP address.

---

<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:** [November 16, 2023, 4:03pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/4 "2023-11-16T16:03:26Z")

</div>

Add a label to a view and create a property binding on its `text` property to  
`session.props.address`

Run the client on each machine and see if you get a unique IP address and check to see if it remains the same on power-cycle. (DHCP will give the next free address in the DHCP range so you'd need to use fixed IP addresses.) If you do get fixed IP addresses then there's a possibility of passing the address to the gateway to modify the view.

---

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [November 16, 2023, 4:23pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/5 "2023-11-16T16:23:34Z")

</div>

I have done something like this before using the device identifier of the terminal where the session is running:

```auto
deviceIdentifier = self.session.props.device.identifier

```

This identifier then gets stored into a database table with the configuration parameters for the view. When the view is loaded it does a lookup into the database with it's own identifier from the session, grabs the correct configuration, and then populates the view. It works pretty well and sounds like it may work for your situation. Just note that this isn't technically tied to IP though.

---

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [November 16, 2023, 4:33pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/6 "2023-11-16T16:33:39Z")

</div>

Ok. Each machine IP address is tied to a unique workcenter\_id also. So that may work.

---

<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:** [November 16, 2023, 6:04pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/7 "2023-11-16T18:04:36Z")

</div>

> [@awaege1](#):
>
> using the device identifier

That is stored in a persistent cookie in browsers, so cannot be relied upon.

---

<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:** [November 20, 2023, 4:40pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/8 "2023-11-20T16:40:33Z")

</div>

You can absolutely do this at the COMPONENT level. Have the main View for the page be completely covered by an Embedded View, then set the path of that Embedded View based on the value of the client address.

---

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [November 21, 2023, 4:28pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/9 "2023-11-21T16:28:39Z")

</div>

So I would create an Embedded View, set the path property to the main page and then bind my script on the params property with an object that represents the ip address?

---

<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:** [November 21, 2023, 4:36pm UTC](https://forum.inductiveautomation.com/t/session-properties/81993/10 "2023-11-21T16:36:22Z")

</div>

1. Create a View with a Flex Layout.
2. Place an Embedded View component into this new View.
3. Set `position.grow` for the Embedded View to be `1`.
4. Bind `EmbeddedView.props.path` to the `clientAddress` prop found within the Session props.
5. Now add a Map Transform to this binding where you list out the specific IP addresses and which Views they should direct to.
