Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear mage-cache-sessid cookie on Ajax Login #12247

Merged
merged 3 commits into from
Nov 30, 2017

Conversation

pmclain
Copy link
Contributor

@pmclain pmclain commented Nov 14, 2017

This PR is a port of https://github.com/magento-partners/magento2ce/pull/74

Description

This PR adds code based on Magento\Customer\Controller\Account\LoginPost::execute to clear the mage-cache-sessid cookie on login. This triggers a refresh of the customer data in localStorage. The primary purpose is to make sure the customer cart is properly loaded after a successful login.

Fixed Issues (if relevant)

When a customer with existing cart items logs in using the authentication-popup the mini-cart does not display their cart items after login.

Manual testing scenarios

  1. Login in using customer/account/login route
  2. Add items to customer cart
  3. Logout
  4. Add virtual product to cart
  5. Open mini-cart and click 'Checkout' to open the authentication-popup
  6. Login using the authentication-popup
  7. The last item cart item will correctly appear merged with the existing quote items in the mini-cart when the page reloads. (Previously only the items from the guest cart would be visible until another action invalidated the cart data in localStorage.)

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Patrick McLain added 2 commits November 14, 2017 08:51
This commit adds code based on
`Magento\Customer\Controller\Account\LoginPost::execute` that clears the
`mage-cache-sessid` cookie on login. This triggers a refresh of the
customer data in localStorage. The primary purpose is to make sure the
customer cart is properly loaded after login.
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Nov 14, 2017

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants