# \[SOLVED\]How to check if user is logged in or not?

**URL:** <https://forum.shopware.com/t/solved-how-to-check-if-user-is-logged-in-or-not/47547>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [14. August 2017 um 08:10 UTC](https://forum.shopware.com/t/solved-how-to-check-if-user-is-logged-in-or-not/47547 "2017-08-14T08:10:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ertuzio](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@ertuzio](https://forum.shopware.com/u/ertuzio)\
**Post date:** [14. August 2017 um 08:10 UTC](https://forum.shopware.com/t/solved-how-to-check-if-user-is-logged-in-or-not/47547/1 "2017-08-14T08:10:28Z")

</div>

There is a global variable $isLoggedIn but when I try to dump like this&nbsp;

```
 {$sUserLoggedIn|@var\_dump}

```

it’s always false!

&nbsp;

---

<div class="post-metadata">

**Author:** ![NextMike](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@NextMike](https://forum.shopware.com/u/NextMike)\
**Post date:** [14. August 2017 um 08:16 UTC](https://forum.shopware.com/t/solved-how-to-check-if-user-is-logged-in-or-not/47547/2 "2017-08-14T08:16:12Z")

</div>

If nothing changed meanwhile, that variable isn’t available everywhere.

Here is a plugin to change that:&nbsp;[Using global variables in templates](https://developers.shopware.com/developers-guide/global-variables-in-templates/)

&nbsp;

---

<div class="post-metadata">

**Author:** ![ertuzio](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@ertuzio](https://forum.shopware.com/u/ertuzio)\
**Post date:** [14. August 2017 um 08:26 UTC](https://forum.shopware.com/t/solved-how-to-check-if-user-is-logged-in-or-not/47547/3 "2017-08-14T08:26:01Z")

</div>

No, I figured it out…there is another global variable&nbsp;

```
 $userLoggedIn

```

and it works perfectly fine…

I tested it like this:&nbsp;

```
 {$userLoggedIn|@var\_dump}

```

&nbsp;

But now i don’t know what is this variable:&nbsp;

```
 $sUserLoggedIn

```

&nbsp;

notice the “s” in front

&nbsp;
