How to show the unread / read status of a forum post, for example, vbulletin, phpbb, others?

This is a million dollar question, I see over and over here and other php related sites and forums, but I NEVER saw an answer to it.

So, I started digging and studying how some of the large high-traffic forums perform this function, showing you which threads have new unread messages in them, and it looks like they store the thread ID number in a user cookie. This way, there will be a cookie with the stream identifier of each stream that you read in a certain amount of time. Or something like that.

Then I read here that cookies can only store X number of characters, so I want to know how much data can be stored in cookies? If I have an identification number of 5-6 characters, how much can I insert in a cookie?

+1
source share
3 answers

Moreover, the cookie specification states that the browser only needs to accept 20 cookies per domain. This limit is increased to 50 from Firefox, and to 30 from Opera, but IE6 and IE7 provide a limit of 20 cookies per domain. Any cookies that go beyond this limit will either beat the old cookie or be ignored / rejected by the browser.

Taken from this post by author

I believe that for the unread / read status of forum posts should be done through a database. I could not find an example on the Internet, but I read "PHP and MySQL Web Development (4th Edition)," and they have a section on developing their own forum page. They provide sample code and explain the process to get started.

+1
source

cookie limit, for example:

no more than 300 cookies

no more than 4096 bytes per cookie (as measured by the size of characters that contain a nonterminal cookie in the description of the syntax of the Set-Cookie header)

no more than 20 cookies per unique host or domain name

0
source

I don’t think they use cookies, because it will not continue if you switch to computers (if only these database-based files are defined by some frameworks). I would suggest that they have a relationship table in the database that keeps track of the last date the user was viewing the stream.

0
source

All Articles