DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Jude U. Joshua
Jude U. Joshua

Posted on

Answer: How to add functionality of β€œRecently visited products” on an ecommerce website?

There are two ways, that I can think of, to do this.

  1. You can store which products they've viewed in a cookie.
  2. You can store their session_id in a database and then store the viewed products in there related to the session_id.

I think the second option is the better…

Top comments (0)

DEV

Thank you.

Β 
Thanks for visiting DEV, we’ve worked really hard to cultivate this great community and would love to have you join us. If you’d like to create an account, you can sign up here.