anantech forum question..

holycow

Senior member
Feb 28, 2001
330
0
0
whenever i connect to anandtech forum via the url forums.anandtech.com, i always see a link on the top right hand side of the screen saying "there are xxxx members logged".. and when u click on it, u will see a list of users that are currently logged in in the forum.. i was wondering how does the forum check and see if a user is logged in or not and how does it update the number of users if someone logged out or left the forum?
 

rootaxs

Platinum Member
Oct 22, 2000
2,487
0
71
well, people who log in to the forums have the option of being logged indefinitely via cookies so you don't have to log in everytime you post.

it's via those same cookies that the forum software can track who's logged in or not.

it can also be very inaccurate as some people may enable this option yet not visit the site for weeks at a time.

I can explain it in further detail but i presume u got the idea.
 

holycow

Senior member
Feb 28, 2001
330
0
0
thx for the reply.. now i understood how it works.. i have one more question.. is there anyway for the forums software to check whether the user is online or not, which then the forum can set the user status as offline..
 

NicColt

Diamond Member
Jul 23, 2000
4,362
0
71
there's a certain timeout for the cookie, if you don't click on anything within a timeframe it will log you out, if you come back the cookie will automatically log you in.
 

holycow

Senior member
Feb 28, 2001
330
0
0
>there's a certain timeout for the cookie, if you don't click on anything
>within a timeframe it will log you out, if you come back the cookie will
>automatically log you in.

how does the forum check to see if your cookie is expired or not? to my understanding is that the forum software can only check the expiration of the cookie when a user clicks on stuffs at the forum, which triggers the update mechanism.. if a user doesn't do anything, there is no way for the forums to update the cookie's status for a specific user, which can be used to determine whether a user is online or not...
 

MacInThebox

Member
Mar 1, 2000
25
0
0
If the number of members logged in is as accurate as I think it is, then on the server side, there is some logic to keep track of who's logged in, when is the last time the user visited the site, and their "session" lifespan. The most straight forward way to do that is using a database.

So what happens is when you request for forums.anandtech.com, the backend logic will query the database for the number of current logged in users and display that on the webpage. There would be some performance tweaks done on the backend so the database does not get bombarded, but here is the basic idea.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |