# Check session variable before delivering cached page

**URL:** <https://forum.shopware.com/t/check-session-variable-before-delivering-cached-page/52365>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [13. April 2018 um 13:26 UTC](https://forum.shopware.com/t/check-session-variable-before-delivering-cached-page/52365 "2018-04-13T13:26:55Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![odessite](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@odessite](https://forum.shopware.com/u/odessite)\
**Post date:** [27. April 2018 um 09:15 UTC](https://forum.shopware.com/t/check-session-variable-before-delivering-cached-page/52365/20 "2018-04-27T09:15:31Z")

</div>

\>because there must be different caches for different customer groups

Right.

&nbsp;

\>- by default user is in customer group called “guest” and therefore can only see the login page  
\>- after logging in user is in “user” group and can browse page normaly.

It’s similar I propose you to do:

\>1. In case you need to do sign in with 3rd service only once - you should create additional group, when user sign up - he can only see sign in to 3rd service page, as soon as this customer sign in - you change group to EK. Then use only shopware auth.

But I’m still don’t sure, customer account on 3rd service can be edited?

&nbsp;

\>Where is this customer group information stored?

I’m not sure what exactly do you mean:

You can create new group via backend - Configuration -\> Basic Settings -\> Shop Settings -\> Customer groups

Data&nbsp; stored in `s_core_customergroups`.

Users tables contain data about group in `s_user`.`customergroup`(there is key, not id).

Current customer groupkey you can find in

```
 Shopware()-\>Session()-\> **sUserGroup**

```

\>How does shopware know which group a user belongs to when opening a page?

You can switch default(guest and customers) group there:

[http://joxi.ru/4Akon7gtyWMlkA](http://joxi.ru/4Akon7gtyWMlkA)

&nbsp;

\>What do I need to implement in the custom login function to assign an user to a group?

I can’t provide stable solution for such case, you can edit session, but I don’t know how offten shopware will update session variable. You can edit customer group after sucessfull login, but then you should find a right way to revert usergroup back to guest…

---

_[View the full topic](https://forum.shopware.com/t/check-session-variable-before-delivering-cached-page/52365)._
