Page 1 of 1

Forum "been read" and "new" question

Posted: Sun Dec 15, 2002 3:15 pm
by Gen-ik
One for the experts here..

I'm in the middle of writing a nice Forum (a bit like this one in fact) and I am wondering which is the best way to go about doing the "has the user read this message or not" thing.

I can see two ways of doing it.

One
Create a cookie that contains all of the info needed, such as the forum message ID and if it has been looked at or not.
Then whenever the page is accessed the code checks the variables in the cookie with the number of messages and replies in the Forum.


Two
When anyone accesses the forum start a new session.
Chuck the session ID into a cookie and create a new row in a mysql table that relates to the session ID and keep all of the forum "has it been read" data in the table.


I'm sure there are a few people out there that have done this sort of thing before and I was just wondering which way you think is better.
Personally if it's possible I would do the session thing.. but I would have to learn about sessions.
The cookie thing I can do now (i've already started on it) but i've got a bad feeling that when the forum starts to fill up the cookie will explode!


Thanks.

Posted: Sun Dec 15, 2002 3:18 pm
by Gen-ik
DOH!

I've just had a thought.

Instead of using either the session thing or a huge cookie couldn't I just send something to a mysql table.. grab the timedate(14) info.. save this to a cookie.. and use this as the users ID for the Forum "have i read it" info?