Hello! There was a question: at various sites there is a function to read the news, after which the given news will no longer be displayed. The question is: Do I need to create a separate table in the database? If so, it turns out that when creating each news item, you need to create an additional entry in the table with the news and user, and create not one record, but how many users do we have registered?
Maybe it’s enough for the user to remember the read news via comma id? Remember infu about N recent read. Suppose the site can display 20 recent news. Then the user in the cookie is enough to remember the last 20 read them. Older ones should be deleted in order not to inflate a cookie.
Upd. I did not add that you need to hide news on the client side with the help of JS. The server distributes to all the same pages. Client's browser is responsible for what to do with the cookies, and what to hide.
Correct approach to the problem from the reverse side. When creating news, do not add anything to the additional table. But then add one entry at the time of reading the news by a specific user. The fact that there is a record in this table will mean that this user has already read this news. When displaying news, you will simply have to skip those news for which there is already a record of reading by this user.