We have some problems with one of our projects. Ocassionally, look's like magento simply redirects to login page when trying to checkout. Is very hard for us to find the problem because happens only sometimes. Because the context of the problem, at first time look hard to reproduce or investigate, but we also found a reproductive method that's generate the same result as the random one. That if you go to /checkout page and simply opens multiple tabs when and paste the same /checkout address into it, the session is lost in browser. This should not be a problem for a customer with a "normal behavior", but neither is normal. The session should be persistent in browser regardless how many requests from how many tabs are opened.
The session is for the current customer and have to re-authenticate into shop
Before lossing the session a rest request to /rest/default/V1/carts/mine/estimate-shipping-methods respond with 401 status code (likely because the cookie don't hit it)
Video link with the method used to reproduce the problem.
Try another browser and do the same process, please.
Because just now I face this problem, But no longer it occurs.
I have to same result on Chrome/Firefox. (latest version both)
Could you try without redis and varnish? We need to exclude them from being the cause.
Ce faci @albertomario? Any news?
@albertomario any news? I have the same problem in a live site that was upgrated to 2.2.2, it is magento enterprise.
@albertomario thank you for your report.
We were not able to reproduce this issue by following the steps you provided. Please try to reproduce this issue on a clean installation without Redis and varnish on just as @Detzlerr described.
We have the same problem with varnish and without redis. It is not possible to always reproduce it, as @albertomario sad it is occasional. If I repeat the same steps I get an error let's say in 10-15% of cases.
And what we found is the same as @albertomario: "Before lossing the session a rest request to /rest/default/V1/carts/mine/estimate-shipping-methods respond with 401 status code".
It doesn't metter the browser I use.
I can reproduce it in Magento Commerce 2.1.9
@albertomario Unfortunately, we can't reproduce this issue.
We checked the behavior on next configuration
What settings are missing from this list, in order for us to reproduce the issue?
@albertomario, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.
FYI we had the same issue on a 2.2.3 without Redis nor Varnish.
It was quite random but the steps where the same :
Disabling SID resolved the issue (for the moment at least).
We're also having the same issue on 2.2.0.
EDIT:
We are using redis but not varnish.
I am also having the same issue on 2.2.3, however it happens whenever I want to make a payment,
It applies only to logged-in users and not guest.
somehow the payment information api (rest/default/V1/carts/mine/payment-information) return 401
and does not recognize customer's session.
This strange behaviour occurs only when the number of payment methods
quite a lot. In my site, I've integrated around 8 payment methods.
I am using bitnami magento 2.2.3 in google cloud.
the problem happens with or without redis/varnish.
This is likely related to https://github.com/magento/magento2/issues/12362.
Checks checkout/model/error-processor.js
Having same intermittent error on EE 2.2.3. Also seeing the rest request to /rest/default/V1/carts/mine/estimate-shipping-methods respond with 401 status code before redirecting back to customer log in page. We have guest checkout disabled. Using Redis & Varnish.
In agreement with @kirkmadera that this is likely related to #12362. Possible solutions:
Upgrade to 2.2.7. The session manager bug was patched here https://github.com/magento/magento2/pull/14973 and released in 2.2.7 (https://github.com/magento/magento2/blob/2.2.7/lib/internal/Magento/Framework/Session/SessionManager.php).
Apply patch containing https://github.com/magento/magento2/pull/14973 fix to your current version. This can be done via cweagans/composer-patches composer module. Official Magento documentation on this approach here: https://support.magento.com/hc/en-us/articles/360005484154-Create-a-patch-for-a-Magento-2-Composer-installation-from-a-GitHub-commit
Since applying this patch/upgrading I've not been able to replicate the issue.
Most helpful comment
FYI we had the same issue on a 2.2.3 without Redis nor Varnish.
It was quite random but the steps where the same :
Disabling SID resolved the issue (for the moment at least).