shopping cart for non registered users

前端 未结 6 900
甜味超标
甜味超标 2020-12-08 01:13

I am in the process of making a website that involves a shopping cart. There are two major requirements:

  1. The user experience guys want login/authentication

6条回答
  •  无人及你
    2020-12-08 01:41

    Store in cookies the AnonymousSessionID, with which you associate a shopping cart in the database.

    Then you'll have a scheduler task to erase anonymous sessions after some time (say, a day). This will keep your database clean of abandoned sessions.

    If a user registers, you reassociate their shopping cart with their account permanently. If the users makes an order, you empty their shopping cart.

提交回复
热议问题