What ways are there to store information about an anonymous/guest user in a database?

后端 未结 8 2421
后悔当初
后悔当初 2021-02-13 15:58

Our application has an online shop among other features, and users are normally requested to register before completing a sale, creating a unique customer_ID in the

8条回答
  •  孤城傲影
    2021-02-13 16:21

    Mmmm ... we generate a uniq ID for guest users -- a hash-value or uuid for the username and store this one in the basket table. You cold store this also in the customer table, if you don't mind cluttering your database with such data. The uuid is stored in a cookie in the customers browser, until he checks out the basket. The cookie thing is also nice for assigning the anonymous account (and the content of it's basket) to a valid account, if the user decided to register later on / before checking out the basket.

提交回复
热议问题