Jump to content
Banner by ~ Ice Princess Silky

Time Spend Online statistic


RrVPfX9cPtw59FpC
Go to solution Solved by Jeric,

Recommended Posts

Hey, there :)

On everyone's profile, there is a statistic reading "Time spent online". My question is, how does the server know when we are online? It can't be when we have a tab open, because I have MLPF open almost always, even when I'm asleep. It also can't be when we "do" something, because the time it takes to process us doing things is pretty much zero seconds. So, what is it? How does the server determine when we are and are not online?

  • Brohoof 1
Link to comment
Share on other sites

But that doesn't make sense... I never log out, even when I go to bed.

Even if you don't log out, when the page is closed the session is still destroyed. You stay logged in when you return because the website will save a cookie onto your computer. 

  • Brohoof 2
Link to comment
Share on other sites

We store data server side not client (browser side), give it an "id", and let the client know (and pass back at every http request) that id. That is a session and it is controlled by server configuratyion, and various files in the software's file system. Sessions expire on the server side after a set time period where there are no more requests from the client side to the server. At this point the 'clock' stops ticking. 

 

 

More specifically, The UID or Session ID is stored in the session data, server-side, after successful identification. Then for every HTTP request we get from the client, the session id (given by the client) will point you to the correct session data (stored by our server) which contains the authenticated user id - that way your code will know what user it is talking to. An HTTP request to view http://mlpforums.com/topic/113359-time-spend-online-statistic/ will be point A in time. If you do nothing for 'x' minutes or hours (depending on server config) then the session is terminated.

 

 

Let me know if that explains things.


 

 

Also forgot to add cookies to my description. Danka @Lato

  • Brohoof 3
Link to comment
Share on other sites

We store data server side not client (browser side), give it an "id", and let the client know (and pass back at every http request) that id. That is a session and it is controlled by server configuratyion, and various files in the software's file system. Sessions expire on the server side after a set time period where there are no more requests from the client side to the server. At this point the 'clock' stops ticking.   More specifically, The UID or Session ID is stored in the session data, server-side, after successful identification. Then for every HTTP request we get from the client, the session id (given by the client) will point you to the correct session data (stored by our server) which contains the authenticated user id - that way your code will know what user it is talking to. An HTTP request to view http://mlpforums.com/topic/113359-time-spend-online-statistic/ will be point A in time. If you do nothing for 'x' minutes or hours (depending on server config) then the session is terminated.  Let me know if that explains things.


 

 

Also forgot to add cookies to my description. Danka @Lato

Yep, that makes sense. Thanks! :)
  • Brohoof 2
Link to comment
Share on other sites

Thank you for bringing this to our attention. We have confirmed the issue and were able to resolve it quickly. We will be marking this as closed. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...