Customer Login not working after 7 Days

I have the following problem: when a customer tries to log in to the shop after 7 days (Shopware 6), they are automatically redirected to the registration page, and no errors are displayed (neither in the Symfony Profiler nor in the devlog). After searching in the system files, I was able to throw an exception in the logs:

An exception was thrown during the handling of a request. {"exception":"[object] (Shopware\\Core\\Checkout\\Cart\\Exception\\CustomerNotLoggedInException(code: 0): Customer is not logged in. at /var/www/html/vendor/shopware/core/Checkout/Cart/CartException.php:69)"}

There, it validates whether a customer exists in the SalesChannelContext, and if not, the error is thrown. However, I don’t understand why there is no customer present.

I am not using Redis. When I create a new customer, I can log in with it for a week without any problems. I have already tried deleting the cookies in the browser, and even when I clear the caches, nothing changes. I suspect that the session is being stored somewhere and becomes invalid after a week, but no (or faulty) new session is generated.

I have also checked the server’s php.ini and the session_save_path specified there, but there are no settings/files that invalidate the session after 7 days.

Since it is a cart exception I guess your cards get deleted after one week. If you try to load the stored cart from the cookie value then this fails.

Does the login not work after 7 days or has the customer just to login again? That is a huge difference.

If the customer attempts to log in 7 days after registration, the error occurs. It doesn’t matter if the customer logged in multiple times during those 7 days or not. The error always occurs 7 days after the initial registration, even if the customer had nothing in their cart.

Can it be a third party plugin? I have never seen that exception in the error.log.

It seems like the error originates from vendor/shopware/core/Framework/Routing/SalesChannelRequestContextResolver.php , where $this->validateLogin($request, $context) is used to validate the request and session. In this function, an exception is thrown.

If the error is originating from vendor/shopware/core/Framework/Routing/SalesChannelRequestContextResolver.php , it’s likely within the core of Shopware rather than being caused by a plugin or am i understanding something wrong?

I createt an eventListener to get this error in the logs, bevore this there was no indicator for any error (only the loading of the registartion page)

If it is a bug, then you can create an issue ticket to get it fixed: