Now I'm creating an e-commerce website. On that website, I'm going to let the user add the product to her/his cart without logging in.
It works as usual:
- User visits the website and adds a product to her/his cart
- If he/she logs in or register, cart items stays the same.
- If he/she leaves and will come back later, cart items stay the same even though he/she doesn't log in.
Right now, I'm storing a cookie in every user's browser and creating a new user in the database. Every time when a user visits, I'm checking a cookie if it exists, I'm searching user data based on that.
Is this method is right? If it is. How can I implement it in Laravel? Now I'm using Vue.js and checking every time and retrieving data from the database.
Aucun commentaire:
Enregistrer un commentaire