How Persistent Cart Works in Magento 2

In Magento 2, the Persistent Shopping Cart does not necessarily follow a solid workflow. In other words, it depends on the value in the backend settings. For each value set to the “Enable Remember Me” and the “Clear Persistence on Logout” fields, the Persistent Cart works in a different way. It also depends on the admin’s decision to select or clear the “Remember Me” checkbox.

When a persistent cookie is activated, a “Not%[the last user’s name]%?” link (Not %John Smith%? for example) will appear in the top of the current page. The function of that link is to give customers options to close the persistent session and start working as a guest or to log in with another account. In addition, the persistent cookie has impact on the workflow of persistent shopping cart. Because it helps to maintain settings for the Shopping Cart, Wish List, Recently Ordered Items, Currently Compared Products, Comparison History, Recently Viewed Products, and Customer Group associations.

The system can also keep tracks of the shopping cart contents, no matter which devices your customers use to shop. For instance, at first, a shopper uses a laptop to add items to her cart. She then can edit the cart contents from a mobile device, and complete the checkout process from a tablet or a desktop computer.

Your store can create and maintain an independent persistent cookie for each browser that is used by a customer to log in or create an account once the persistent shopping cart is applied. Thanks to the persistent cookie, any changes made will be updated to browsers even if the customer use more than one browser for one time shopping on your store.

There are four common effects on the persistent shopping cart workflow, which depends on the settings below:

Situation 1: Enable Remember Me = “No”

Clear Persistence on Log Out = any value

Effects: The Remember Me checkbox is not available when customers on the login and registration pages. The persistent cookie is not applied.

Situation 2: Enable Remember Me = “Yes”

Clear Persistence on Log Out = any value

Remember Me = (not being selected)

Effects: The session cookie is applied as usual; the persistent cookie is not used.

Situation 3: Enable Remember Me = “Yes”

Clear Persistence on Log Out = “Yes”

Remember Me = “Yes”

Effects: Both session and persistent cookies are enabled when customers log in. These two cookies are also terminated when buyers finish shopping and log out. If a customer does not log in, but the session cookie become invalid, the persistent cookie still keep working. If a customer does not log out, the persistent cookie can also be deleted if its lifetime is out of due or if the customer clicks the Not %John Smith% link.

Situation 4: Enable Remember Me = “Yes”

Clear Persistence on Log Out = “No”

Remember Me = “Yes”

Effects: Both cookies are used when customers log in. When shoppers log out, only session cookie is closed. Persistent cookie is deleted only when its lifetime runs out or when the buyer click the Not %John Smith% link.

Clearly understand how Persistent Shopping Cart works with different values set to it will help you a lot in managing your online store. Therefore, come back to the beginning and read again this article if you still confuse about Persistent Shopping Cart workflow. If not, keep follow us to receive more instructions about Persistent Shopping Cart in Magento 2.