Item cart session/ctx or backend?
I want to create a cart functionality for my shopping app and I am wondering which approach should I choose for implementing it. I thinking more towards using session but I can't figure out where I can add new stuff to it. Would anybody share their opinion on this topic? Also if you know how to add custom stuff to session and then add some objects to it on some interaction that please share you knowledge. Thanks!
2 Replies
https://nextjs.org/docs/advanced-features/middleware#producing-a-response
I’m fairly new to this but I believe this is what you’re looking for
Advanced Features: Middleware | Next.js
Learn how to use Middleware to run code before a request is completed.
I'll have a look into that thanks!