Magento2: Hit fast twice F5 on checout page, customer loggs out automatically

Created on 26 Apr 2016  路  24Comments  路  Source: magento/magento2

Steps to reproduce

  1. http://magento2-demo.nexcess.net or Magento 2.0.4 with cache enabled (page cache too).
  2. Have products in cart as logged in customer
  3. Go to checkout page.
  4. Hit fast twice F5 key in browser
  5. Customer is not logged in anymore.

Expected result

  1. Customer should stay as logged in

Actual result

  1. Customer is not logged in anymore

It may be related to module-customer/view/frontend/web/js/customer-data.js

Thank you

Frontend Fixed in 2.2.x Fixed in 2.3.x Clear Description Confirmed Format is not valid Ready for Work Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x bug report

All 24 comments

internal issues (related) MAGETWO-32380

Yes you also have this issue if you stop the page load mid-way through on the checkout. Cart is emptied and customer logged out

and the minicart still shows the items after this logout happens

Actually the 2 times hit happens on every button or link that points to cart or checkout. Hit twice checkout button on cart page. Why would I hit twice: high traffic, server isn't serving pages fast enough or I just don't see in browser that the next page is loading - sent request. The following statement isn't related to the current issue: hit checkout button on cart page while cart page sections are still loading.

@daniel-ifrim @Zaylril is it still reproducible for you on 2.0.9 or 2.1.11? if so, please clarify if you use secure catalog and secure checkout.

Tried double hitting F5 on checkout and didn't reproduce the issue. Version 2.1.1.

I can reproduce this issue in 2.0.6, but it seems it is fixed in 2.1.1

@SerhiyShkolyarenko I don't have 2.1.1 anywhere. If it works for you it works for any than. Thank you!

Reproduced the issue on 2.0.9. Ticket for backporting fix is MAGETWO-57341. Thanks everybody for taking part!

@daniel-ifrim, thank you for your report.
We've created internal ticket(s) MAGETWO-80855 to track progress on the issue.

I'm experiencing this behavior on two 2.1.9 sites. Another way to reproduce the issue is:

  1. Add a product to cart.
  2. From the mini-cart, click the "Go To Checkout" button and then immediately click the "View and edit cart" link.
  3. The cart will be empty with this error message: "You have no items in your shopping cart."

I'm experiencing this behavior on Magento 2.2 too.

Doing some research i found in method Magento\Checkout\Controller\Index\Index::execute(), around line 35, a call to $this->_customerSession->regenerateId().

When we fire two (or more) subsequent requests, they come to the server with the same session id. But the first request regenerates the session id, getting a new one (and destroying the last one), so the latter requests are getting an empty session.

Maybe there is some magento store/webserver configuration that i am forgetting about, sorry if that's the case.

Using Apache/2.4.18 (Ubuntu) with PHP 7.0.27.

This appears to be related to #12362. I've experienced this issue recently on a Magento 2.2.2 installation.

Replicating on M2.1.10 Commerce

Subscribing. We are also seeing this as well as the related issues mentioned in this thread and other threads that mention this one.

distributed-cd

@obatkova thank you for joining. Please accept team invitation here and self-assign the issue.

cannot reproduce the issue on the M2.1.14 and M2.2

Have you tried @obatkova with PHP 7.x and Redis for session cache storage?

Closing this issue in favor of the more popular duplicate ticket.
Please continue tracking and discussion under https://github.com/magento/magento2/issues/12362
Thank you

Hi @daniel-ifrim. Thank you for your report.
The issue has been fixed in magento/magento2#14428 by @adrian-martinez-interactiv4 in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.5 release.

Hi @daniel-ifrim. Thank you for your report.
The issue has been fixed in magento/magento2#14429 by @adrian-martinez-interactiv4 in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

@magento-engcom-team
Any fix available for 2.1.x v ?
have the same issue with
php 7
magento 2.1.12
Debian
Maria DB

@nmallepally I applied this patch https://github.com/magento/magento2/commit/a6f146cd9302fbbb6305df9613c7ce3eea7a05ae and it is fixed for me, Magento 2.1.12 PHP7.

Was this page helpful?
0 / 5 - 0 ratings