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

Cart is lost after logging in again #3668

Closed
nyze2oo9 opened this issue Apr 15, 2024 · 4 comments
Closed

Cart is lost after logging in again #3668

nyze2oo9 opened this issue Apr 15, 2024 · 4 comments
Labels

Comments

@nyze2oo9
Copy link

PHP Version

8.3

Shopware Version

6.5.8.8

Expected behaviour

  1. A customer logs in via store-api.account.login
  2. The customer add at least one product to the cart store-api.checkout.cart.add
  3. The customer logs out via store-api.account.logout
  4. The customer logs in again.

The old cart should be linked to the new context token or the old context token should be linked to the customer again.

Actual behaviour

  1. A customer logs in via store-api.account.login
  2. The customer add at least one product to the cart store-api.checkout.cart.add
  3. The customer logs out via store-api.account.logout
  4. The customer logs in again.

Old context is still in sales_channel_api_context

  {
    "token": "1",
    "payload": "{\"expired\": false, \"customerId\": null}",
    "sales_channel_id": "...",
    "customer_id": null,
    "updated_at": "2024-04-15 13:54:06"
  }

A new context exists:

  {
    "token": "2",
    "payload": "{\"expired\": false, \"customerId\": \"018ed64348c27210a98e3dacbe47c4ef\", \"permissions\": [], \"billingAddressId\": null, \"shippingAddressId\": null}",
    "sales_channel_id": "...",
    "customer_id": "018ED64348C27210A98E3DACBE47C4EF",
    "updated_at": "2024-04-15 13:58:36"
  }

Old Cart is still there with old context token:

  {
    "token": "1",
     ...
    "customer_id": "018ED64348C27210A98E3DACBE47C4EF",
    ...
  }

How to reproduce

  1. A customer logs in via store-api.account.login
  2. The customer add at least one product to the cart store-api.checkout.cart.add
  3. The customer logs out via store-api.account.logout
  4. The customer logs in again.
  5. Cart is empty
@nyze2oo9 nyze2oo9 added the Bug label Apr 15, 2024
@jmatthiesen81
Copy link
Contributor

jmatthiesen81 commented Apr 16, 2024

The issue is already known https://issues.shopware.com/issues/NEXT-35111. @shyim implemented a fix and released a new version of the security plugin fixing this issue (https://store.shopware.com/en/swag136939272659f/shopware-6-security-plugin.html see changelog). The fix will be also included in the next Shopware release.

@shyim
Copy link
Member

shyim commented Apr 16, 2024

fix is merged, 7dcf5ab
we are waiting for a bugfix that theme compile is not executed when you use subbundles to make a release

@shyim
Copy link
Member

shyim commented Apr 16, 2024

6.5 version has been released

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

No branches or pull requests

3 participants