DEV Community

Jude Joshua
Jude 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)