magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.54k stars 9.32k forks source link

Logged-in user has to re-login before checkout #7554

Closed sigismund closed 7 years ago

sigismund commented 7 years ago

Preconditions

  1. Magento 2.1.2, 2.1.9 PHP7
  2. User is logged in
  3. Guest checkout is disabled

Steps to reproduce

  1. Login in
  2. Add product to cart
  3. In top bar there is text "Welcome Michael Surname", but there is still option to sign-in and sign-up next to it.
  4. Go to cart > checkout
  5. Login prompt is displayed

Expected result

  1. When user is logged-in and "Wecome user" is displayed, there shouldn't be any sign in/up link next to it, just sign out.
  2. User should be able to checkout without re-login in checkout process.

Actual result

  1. User is somehow semi-logged in. Part of Magento detects it, but other part doesn't.
SerhiyShkolyarenko commented 7 years ago

@sigismund thank you for the report! Tried these steps on the develop branch and on v2.1.2 but didn't reproduce it.

Go to cart > checkout

Does it mean clicking "Go to Checkout" button on minicart? What were your other steps after installation? Did you perform any configuration changes?

SerhiyShkolyarenko commented 7 years ago

In top bar there is text "Welcome Michael Surname", but there is still option to sign-in and sign-up next to it.

@sigismund it seems you customer session is expired. In such case Magento leaves "Welcome Michael Surname"(it's a bug), but shows "Sign In" link.

flnative commented 7 years ago

Same issue with 2.1.2. I cannot checkout. The system thinks I'm logged out even though I login a bunch of times. I get the Welcome (name) on top, but still shows "sign in" link. I cannot make a purchase no matter what I do. Damn, I wish I never installed this version for a production site. It has been a year and I cannot even make an order on the front end.

taschert commented 7 years ago

Same issue with 2.1.0. Is there a fix for this issue ? I found this 2 related issue #6759 & #4589

Kentricks commented 7 years ago

Hi, I have the same issue on 2.1.7, did anyone know if a fix is ongoing ?

veloraven commented 7 years ago

@Kentricks could you please provide more information then? Please specify which versions of OS, web-server, PHP, MySQL you use. Do you use any external extensions? Do you use persistent shopping cart functionality? Did you change value for Online Minutes Interval? (Stores > Settings > Configuration > Customers > Customer Configuration -> Online Customers Options) Could you please provide a screenshot?

elisei commented 7 years ago

magento v. 2.1.9 and the problem persists!

magento-engcom-team commented 7 years ago

@elisei thank you for update. We updated issue description

magento-engcom-team commented 7 years ago

We cannot reproduce this issue as described. Please provide the detailed steps we must follow to reproduce this issue. In addition, and any other information needed to reproduce your issue.

elisei commented 7 years ago

hello follows an error gif. sep 21 2017 12-03 pm

Process I've already tried based on the guideline here:

I have extra extensions: smtp - mageplaza moip (which I'm developing now). I've tried uninstalling them but the problem continues.

Php v, 7.0.23 ubuntu14.04.1

magento-engcom-team commented 7 years ago

@sigismund, thank you for your report. The issue is already fixed in 2.2.0

phronesis commented 7 years ago

I find it really odd when a bug reported in a minor version(semver) is fixed in another minor version without being backported to the version it was reported in. From my experience, If I dare update to 2.2, I'll find much more bugs introduced there. So updating to 2.2 is a 'NO' for some of us. Could you point us to the commit that fixed this issue, so we can create a patch for the 2.1.x branch, if Magento does not see this issue as critical enough to be backported? Thank you.

ghost commented 6 years ago

I couldn't agree more. Moving from 2.1.9 to 2.2.0 means being forced to PHP 7.0+ as well. Which, in our case - on this system, isn't an option.

It would be truly useful to patch 2.1.9- to fix this issue.

cristian1991 commented 6 years ago

Any updates on the issue? I know that asking for a fix might be too much, but, at least, did anyone find a stack trace for the bug so the community might give it a chance into fixing the issue?

VivianWang1993 commented 6 years ago

Could you write the code branch that how to fix this bug here, please? We can't update to Magento 2.2 in short period. Thank you very much

phronesis commented 6 years ago

For those still experiencing this issue, this is the commit that fixes it: https://github.com/magento/magento2/commit/861f596371825d9e24672cd613229ae9486c635f . Digging into the code, this only applies if your request is a 'POST' request - that makes sense. If your request for some reason, is not a 'POST' request, you may need to make some modification

iindranil commented 3 years ago

This issue still exists with Magento ver. 2.4.2

I've tried with @phronesis solution but no luck. Right now, I am using the latest version (2.4.2) of Magento and what I need to do?

Should I wait for the next version release? Lol

ziarv commented 2 years ago

This issue still exists with Magento ver. 2.4.2

shaileshbhagaliya commented 2 years ago

this issue also came on magento ver 4.2.3 too

Mr-Leonerrr commented 1 year ago

The issue still happening in Adobe Commerce 2.4.6-p1

magewallet commented 8 months ago

This is still happening 2.4.6-p1

FuscaSoftware commented 7 months ago

After multiple updates we repeatly get these problems with customers hanging in a re-login loop. To break out from this loop I did a little dirty customization in sidebar.js and proceed-to-checkout.js in [template]/Magento_Checkout/web/js:

            if (!customer().firstname) {
                var sections = ['cart', 'customer'];
                 customerData.invalidate(sections);
                 customerData.reload(sections, true);
            }

before:

if (!customer().firstname && cart().isGuestCheckoutAllowed === false) {