# Check for Logged In User on Public Page

**URL:** <https://forums.knack.com/t/check-for-logged-in-user-on-public-page/11507>\
**Category:** API & Custom Code\
**Created:** [November 8, 2021, 7:36pm UTC](https://forums.knack.com/t/check-for-logged-in-user-on-public-page/11507 "2021-11-08T19:36:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JBS](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@JBS](https://forums.knack.com/u/JBS)\
**Post date:** [November 8, 2021, 7:36pm UTC](https://forums.knack.com/t/check-for-logged-in-user-on-public-page/11507/1 "2021-11-08T19:36:32Z")

</div>

Hello,

I would like to show a top menu when a user is logged in across my app similar to the user info bar built in to knack.

This works fine on the pages that require a login but on the public pages it disappears.

When I try to retrieve the user data myself using Knack.getUserAttributes(); using these scenes rendering as the trigger, I get the result ‘No user found’.

I can’t use page rules on these pages since they are public.

I just want the user to see they are logged in and have a link to their account page even if they are currently on a public page.

---

<div class="post-metadata">

**Author:** ![JulianKirkness](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/juliankirkness/32/770_2.png) [@JulianKirkness](https://forums.knack.com/u/JulianKirkness)\
**Post date:** [November 8, 2021, 9:38pm UTC](https://forums.knack.com/t/check-for-logged-in-user-on-public-page/11507/2 "2021-11-08T21:38:40Z")

</div>

Not certain about this but you could try storing the users name and I’d in session variables using sessionStorage.setItem - and the display somewhere in the app.

---

<div class="post-metadata">

**Author:** ![KnackPros](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/knackpros/32/807_2.png) [@KnackPros](https://forums.knack.com/u/KnackPros)\
**Post date:** [November 27, 2021, 3:26am UTC](https://forums.knack.com/t/check-for-logged-in-user-on-public-page/11507/3 "2021-11-27T03:26:22Z")

</div>

Hi @JBS,

I use the event trigger for `scene-render.any` and it works. Then I inject the top menu on every page if it’s not found.

Happy to help you out if you would like, just let me know.

Thanks,  
Ian  
[www.knackpros.com](https://www.knackpros.com)
