# How is session.props.device.identifier generated?

**URL:** <https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560>\
**Category:** Ignition Early Access\
**Created:** [March 25, 2019, 11:03am UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560 "2019-03-25T11:03:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![waldner](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@waldner](https://forum.inductiveautomation.com/u/waldner)\
**Post date:** [March 25, 2019, 11:03am UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560/1 "2019-03-25T11:03:10Z")

</div>

I see that the device identifier session property that ignition generates is a UUID. Would it be possible to know how it’s generated? I suppose it uses some info from the device, like the MAC address or the IMEI.

Thanks

---

<div class="post-metadata">

**Author:** ![mrojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrojas/32/6394_2.png) [@mrojas](https://forum.inductiveautomation.com/u/mrojas)\
**Post date:** [March 25, 2019, 5:27pm UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560/2 "2019-03-25T17:27:34Z")

</div>

They are randomly generated and stored locally. If you uninstall and reinstall or clear app data you’ll get a new UUID.

---

<div class="post-metadata">

**Author:** ![waldner](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@waldner](https://forum.inductiveautomation.com/u/waldner)\
**Post date:** [March 25, 2019, 5:36pm UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560/3 "2019-03-25T17:36:21Z")

</div>

So there’s no way to have a permanent, deterministic device id guaranteed to univocally identify a device? (Regardless of reinstalls)

---

<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:** [March 25, 2019, 5:43pm UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560/4 "2019-03-25T17:43:52Z")

</div>

Not from scripting (as those scripts would all be run on/against the Gateway in Perspective). I don’t know that there is a way to provide something in Session.props which would obtain some value rom the Device, but I’ll have to leave the definitive answer for that to someone from Dev.

You could request that a user _supply_ an identifier which is present _on the device_, a la “Enter Device Serial”, and have the serial number stamped/labelled on each device.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 25, 2019, 5:44pm UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560/5 "2019-03-25T17:44:45Z")

</div>

> [@waldner](#):
>
> So there’s no way to have a permanent, deterministic device id guaranteed to univocally identify a device? (Regardless of reinstalls)

Really, there's no way to do this in any reliable sense for any computing device. MAC addresses, user agents, screen resolutions, etc, can all be _trivially_ spoofed. Collecting the IMEI of every user's device is invasive, and, in a post-GDPR world, potentially illegal - not something that should be done lightly.

---

<div class="post-metadata">

**Author:** ![waldner](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@waldner](https://forum.inductiveautomation.com/u/waldner)\
**Post date:** [March 25, 2019, 6:28pm UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560/6 "2019-03-25T18:28:46Z")

</div>

> [@cmallonee](#):
>
> You could request that a user _supply_ an identifier which is present _on the device_ , a la “Enter Device Serial”, and have the serial number stamped/labelled on each device.

Sure, but that wouldn't come through or be available at the beginning of the perspective session. I need something to use to identify a given device even if its perspective session changes (eg due to disconnection from gateway because of poor connectivity).

---

<div class="post-metadata">

**Author:** ![waldner](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@waldner](https://forum.inductiveautomation.com/u/waldner)\
**Post date:** [March 25, 2019, 6:31pm UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560/7 "2019-03-25T18:31:37Z")

</div>

The IMEI would be used only to generate the device ID (which would then be immutable) and not stored or communicated or transmitted in any other way.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 25, 2019, 6:40pm UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560/8 "2019-03-25T18:40:02Z")

</div>

> [@waldner](#):
>
> I need something to use to identify a given device even if its perspective session changes (eg due to disconnection from gateway because of poor connectivity).

The current identifier already does this - it's stored _on the device_, so unless you have users specifically looking to clear application data, this will already meet your needs.

---

<div class="post-metadata">

**Author:** ![waldner](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@waldner](https://forum.inductiveautomation.com/u/waldner)\
**Post date:** [March 25, 2019, 7:47pm UTC](https://forum.inductiveautomation.com/t/how-is-session-props-device-identifier-generated/23560/9 "2019-03-25T19:47:07Z")

</div>

Phones could be reset to factory or sent to service, which would likely delete everything. Moreover, I need to tie an ignition device id to a phone entry in a database, so the id should really be immutable (and possibly predictable, so I could store the ignition device id in the db when a new phone arrives and the operator creates it in the backoffice app), hence my original question.
