Jump to content

Forum cookie?


seventheyejosh

Recommended Posts

I'm not sure if this is the right section, as i've never done anything this confusing before.

 

What is the lightest way to hit a server to see if someone has viewed a forum post?

 

The 3 things im thinking:

 

1. Pull everything from a forum views table when the user logs in and store it in a session variable, then check against that. however, im not sure the size limit on one.

 

2. use said table, but just run thru that on every page load. this would be easiest, but would fill up very quickly.

 

3. i was thinking maybe using a cookie, and would really like to go with this route, but im not sure where to start with this. Any suggestions for help or tutorials on cookies?

 

Thanks in advance to all!

Link to comment
https://forums.phpfreaks.com/topic/139731-forum-cookie/
Share on other sites

There are a few ways of going about marking forums as read, vBulletin's docs may give you an idea or two.

 

1) Inactivity/Cookie Based - once a user has been inactive for a certain amount of time (the value of the cookie timeout option) all threads and forums are considered read. Individual threads are marked as read within a session via cookies. This option is how all versions of vBulletin before 3.5 functioned.

2) Database (no automatic forum marking) - this option uses the database to store thread and forum read times. This allows accurate read markers to be kept indefinitely. However, in order for a forum to be marked read when all threads are read, the user must view the list of threads for that forum. This option is more space and processor intensive than inactivity-based marking.

3) Database (automatic forum marking) - this option is the same as a previous option, but forums are automatically marked as read when the last new thread is read. This is the most usable option for end users, but most processor intensive.

Link to comment
https://forums.phpfreaks.com/topic/139731-forum-cookie/#findComment-731064
Share on other sites

so can you update cookies? like when a user views another post, it updates the cookie to have that id as well? will it overwrite the old cookie of the same name?

 

like if $value is all of the posts the user has viewed, can you do

 

$value.=$id

 

setcookie  $value etc ?

Link to comment
https://forums.phpfreaks.com/topic/139731-forum-cookie/#findComment-731074
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.