Check session variable before delivering cached page

I did end up making an ugly hack arround it in the end… by simply fetching the session data from the database (since we are using the db driver for sessions) and checking before the caching is invoked. I’m not booting up the whole shopware, just making a db connection and executing that one query, so the performance hit should not be too much of a problem.

 

The login is not handled by the 3rd party service. the 3rd party service just provides the user data in batches, once per week or so there are 1000-10000 potential new users and those are then imported (via cron job) into the custom users table (in shopware database), that is then used to check if user has the access to the site.

I need to look into how customer groups are working, because there must be different caches for different customer groups, but I don’t know how i can say

  • 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.
    Where is this customer group information stored? How does shopware know which group a user belongs to when opening a page? What do I need to implement in the custom login function to assign an user to a group?

So for now it is working, but it’s for sure not pretty and not the right way to go about this, but it was driving me crazy already