In magento 2.2.5 I added a recently viewed widget block that way:

<block class="Magento\Catalog\Block\Widget\RecentlyViewed" name="category.recently_viewed" template="Magento_Catalog::product/widget/viewed/grid.phtml" after="-">
        <argument name="uiComponent" xsi:type="string">widget_recently_viewed</argument>
        <argument name="page_size" xsi:type="number">4</argument>
        <argument name="show_attributes" xsi:type="string">name,image,price,learn_more</argument>

It does work but noticed that products in that listing only last a few minutes before being "forgotten" is there a way to increase that cookie lifetime to few hours.

1 Answer 1


You just need to set below configuration

Stores > Configuration > Catalog > Catalog > Recently Viewed/Compared Products > Lifetime of products in Recently Viewed Widget

enter image description here

You can set any higher value depends upon your requirement, like I set 50000.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.