Dear heroes, I have designed a small news reading/social networking website. I want to write the information of the interest groups to which the user belongs, as well as the serial number of the news the user has read today and the serial number of the news he has read, into the cookie information (of course The news list will be updated every day), is this design appropriate?
It is best to write each operation to redis and store it in the database when the business is at low peak every day. Neither session nor cookie storage is a good engineering implementation. And if the user clears the cache, won’t all the cookie data be lost?
Cookies are best used only to store some simple user IDs. If you just store simple serial numbers, there is no problem. When it comes to account passwords, it is best to use sessions. There is no problem in logging in every day to update cookies.
Yes, it is possible, but if there are too many, it will increase the complexity and may not be necessary
Save it in the database. To facilitate future expansion. For example, just push cookies such as related news