# Null login show after some time in the persepective

**URL:** <https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019>\
**Category:** Ignition\
**Created:** [December 12, 2021, 7:37am UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019 "2021-12-12T07:37:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajaykumar\_Unhale](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ajaykumar\_Unhale](https://forum.inductiveautomation.com/u/Ajaykumar_Unhale)\
**Post date:** [December 12, 2021, 7:37am UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/1 "2021-12-12T07:37:46Z")

</div>

Hello,

I have create some views and use login and logout option by adding some script  
for login I bind to label text I use this {session.props.auth.user.userName}  
for logout  
if self.session.props.auth.authenticated:  
system.perspective.logout()  
else:  
system.perspective.login()

Now the problem is if I am not working on the screen after some time automatically showing “null” in the login user name that I display userName on label

1. What is the meaning of this Null in login?
2. How we can avoid this?
3. Can we make it automatically logout if user is not use the launch screen for sometime or user not use screen for longer duration?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 12, 2021, 10:01am UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/2 "2021-12-12T10:01:11Z")

</div>

When the username is null it means that there is no user logged in. I usually override null and display something like ‘guest’ instead.

You can set the auto logout from the project properties. Just note that while it will log the user out, the idp may still remember the login and clicking login again will then auto login the last user. You can avoid that by setting an option I believe in the idp settings, I can’t remember off the top of my head

---

<div class="post-metadata">

**Author:** ![Ajaykumar\_Unhale](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ajaykumar\_Unhale](https://forum.inductiveautomation.com/u/Ajaykumar_Unhale)\
**Post date:** [December 13, 2021, 1:01pm UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/3 "2021-12-13T13:01:14Z")

</div>

Hello,  
Can anyone help me to resolve this null login issue…

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [December 13, 2021, 4:30pm UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/4 "2021-12-13T16:30:04Z")

</div>

I believe @nminchin did. If that didn’t solve your problem, you might want to say why, so that we know what to work with.

---

<div class="post-metadata">

**Author:** ![Ajaykumar\_Unhale](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@Ajaykumar\_Unhale](https://forum.inductiveautomation.com/u/Ajaykumar_Unhale)\
**Post date:** [December 14, 2021, 6:50am UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/5 "2021-12-14T06:50:13Z")

</div>

Hello,  
Did not solve my problem,  
I can access all screen component on launch window but still login showing user name as null. so can we make automatic logout after some time if user is not use the launch screen

---

<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:** [December 14, 2021, 11:00am UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/6 "2021-12-14T11:00:35Z")

</div>

If the user is null, there’s no logout to do. You should be inspecting your page and view designs to ensure you’ve required security where you need it. Perspective allows anonymous users unless you add restrictions.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 14, 2021, 9:25pm UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/7 "2021-12-14T21:25:13Z")

</div>

If you don’t want users to have access to your app at all without logging in, use the project properties to deny unauthenticated access. Otherwise, do as Phil said and disable actions on your View components based on roles/etc for example using the `hasRole(...)` function

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/e/8e50a1e771b2e5bd9c7ed2b9b79bd8f6dd339bdf.png)

---

<div class="post-metadata">

**Author:** ![Namya](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@Namya](https://forum.inductiveautomation.com/u/Namya)\
**Post date:** [July 12, 2023, 6:56am UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/8 "2023-07-12T06:56:07Z")

</div>

Hello, how can I override null and display "guest" please?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 12, 2023, 6:58am UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/9 "2023-07-12T06:58:23Z")

</div>

`coalesce(None, 'Guest'))`, where `None` is replaced by the expression that is giving you the null

---

<div class="post-metadata">

**Author:** ![Namya](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@Namya](https://forum.inductiveautomation.com/u/Namya)\
**Post date:** [July 12, 2023, 7:15am UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/10 "2023-07-12T07:15:09Z")

</div>

thx, where can I put it in my label's properties? (I'm new here)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 12, 2023, 7:16am UTC](https://forum.inductiveautomation.com/t/null-login-show-after-some-time-in-the-persepective/54019/11 "2023-07-12T07:16:53Z")

</div>

Use an expression binding on the `text` property of your label.  
And I suggest you go through [Inductive University](https://inductiveuniversity.com/), it will teach you the basics.
