Open mcmaceac opened 6 years ago
Right now, the user can only add items to their cart if they are logged in. I don't know the best way we would integrate anonymous users to have shopping carts since they would have to log in anyway, and if they have items already in their cart it would be weird to merge the two carts.
If a user is logged in their shopping cart data should be stored on the database. If the user is anonymous the shopping cart data should be stored in a cookie so the data can be retrieved when the user reopens the website.
See https://stackoverflow.com/questions/147636/best-way-to-detect-when-a-user-leaves-a-web-page for saving data in cookies before closing page.