NobleTyler / Freshbooks

A book store built on a Java Backend Running Apache Tomcat, with a bootstrap front end
MIT License
0 stars 3 forks source link

Shopping cart persistence #4

Open mcmaceac opened 6 years ago

mcmaceac commented 6 years ago

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.

mcmaceac commented 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.