Jump to content
Banner by ~ Wizard

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

This signature was removed for being too obnoxious and arrogant.




-Makusu2


By the way, if you're talking to me in a thread, please quote my previous post. Otherwise, I might not respond to you.

Link to comment
Share on other sites

If the session (your login) is active, then you're online. Sessions are destroyed when the page is closed or the user logs out.

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

This signature was removed for being too obnoxious and arrogant.




-Makusu2


By the way, if you're talking to me in a thread, please quote my previous post. Otherwise, I might not respond to you.

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

11jpz14.jpg

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

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.

 

But I never close the tab.
  • Brohoof 1

This signature was removed for being too obnoxious and arrogant.




-Makusu2


By the way, if you're talking to me in a thread, please quote my previous post. Otherwise, I might not respond to you.

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

This signature was removed for being too obnoxious and arrogant.




-Makusu2


By the way, if you're talking to me in a thread, please quote my previous post. Otherwise, I might not respond to you.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...