when you try to log console.log("session", session)
in your cart.js
what is the output of the log? one other question: Did you check your connection string for mongoDB usually it is different on production from the one you use for development/staging the case might be that you have issue with the database connection, it may return null and triggering a redirect. try adding these logs inside the checkout.js
: console.log("User from DB:", user); console.log("Cart from DB:", cart);