# Perspective: session.props.device.identifier changing during session?

**URL:** <https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045>\
**Category:** Ignition\
**Created:** [February 7, 2020, 3:18pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045 "2020-02-07T15:18:26Z")\
**Posts on this page:** 10\
**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:** [February 7, 2020, 3:18pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/1 "2020-02-07T15:18:27Z")

</div>

Ignition 8.0.7, I’m seeing a strange issue where `session.props.device.identifier` in `onStartup(session)` has a value, but then, later, extracting `self.session.props.device.identifier` in a `runAction(self, event)` function for a button onClick event handler returns a different ID. The perspective session is running on an android phone. Am I doing something wrong?

---

<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:** [February 10, 2020, 4:53pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/2 "2020-02-10T16:53:57Z")

</div>

Is more information needed? My application depends on device IDs deing unique and not changing, so this is a big blocker for us.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 10, 2020, 6:31pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/3 "2020-02-10T18:31:58Z")

</div>

Someone from QA is going to try to replicate this. They’ll post here if they need more information.

---

<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:** [February 10, 2020, 6:38pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/4 "2020-02-10T18:38:15Z")

</div>

What model of phone? Do you know which android version is being used? Is this during a long-running session?

I’ve been unable to replicate this during a simple setup where I have a Label bound to `session.props.device.identifier` (this value never seems to change) and I also have a button which invokes the `onClick` Event and then sets its own text to whatever the value of `self.session.props.device.identifier` is (which through my testing has always matched the value found on the neighboring Label.

What are the two values you are seeing? (if one looks obviously wrong, it could help to diagnose what value you are actually getting)

---

<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:** [February 10, 2020, 6:40pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/5 "2020-02-10T18:40:59Z")

</div>

The session startup event happens awfully early in the life cycle. This might just be one of the values that isn’t initialized yet.

---

<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:** [February 10, 2020, 6:57pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/6 "2020-02-10T18:57:12Z")

</div>

I was worried about that too, but I do seem to be getting the same value during session startup.

---

<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:** [February 10, 2020, 6:57pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/7 "2020-02-10T18:57:31Z")

</div>

Android version is 6.0 (yes I know it’s old).  
I’m seeing two UUIDs, not that the actual values matter, but the first one in `onStartup()` is 1067cbc1-3084-45f9-b20f-7972bb912d01, the one I see later (which seems to not change thereafter) is 5bd8a5d3-2d2d-48e9-9a6a-9d2ad5dc4150.  
To check, I’m just logging the values and looking at the logs via the web interface. Here’s the code I use to log:

```auto

def log(msg):
  project_name = system.util.getProjectName()
  logger = system.util.getLogger(project_name)
  logger.info(msg)

```

---

<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:** [February 10, 2020, 7:03pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/8 "2020-02-10T19:03:27Z")

</div>

Darn, I just retried and now the device identifier is already 5bd8a5d3-2d2d-48e9-9a6a-9d2ad5dc4150 in `onStartup()`. Not sure what’s going on, I swear I saw the problem for a whole day last time.

---

<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:** [February 10, 2020, 7:03pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/9 "2020-02-10T19:03:40Z")

</div>

That code will not affect anything as it’s just logging a value. Could you provide snippets of code were you are actually referencing and using the property being discussed? In speaking with our mobile developer, the device identifier is created on application installation (for mobile devices) and so should not change unless the application is uninstalled and then re-installed.

---

<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:** [February 10, 2020, 7:04pm UTC](https://forum.inductiveautomation.com/t/perspective-session-props-device-identifier-changing-during-session/32045/10 "2020-02-10T19:04:38Z")

</div>

Ah, I did do an upgrade of the app from the play store (before doing anything else though), could this play a role?
