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

后端 未结 8 2438
后悔当初
后悔当初 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:22

    I usually use the user IP, I create an account with just an ID and his IP address. When he registers, I just update his record. Other things than IP could (and should) be used too, like creating a random token to put in a cookie to bypass any session system in use so you can make it last longer for example.

    Now, in the application, you have to make your user class able to "identify" your users with either this IP/token, a real session or any other login system you may have in place.

提交回复
热议问题