ohdang888 Posted April 10, 2008 Share Posted April 10, 2008 is there a way to count the number of active sessions on your server? I know you could enter them into a db, but is there any way to do count thm without a db? Thanks, Link to comment https://forums.phpfreaks.com/topic/100411-count-sessions/ Share on other sites More sharing options...
Caesar Posted April 10, 2008 Share Posted April 10, 2008 Not really. Since the session temp files don't get deleted when a user simply closes their browser. So not really any reliable way. Link to comment https://forums.phpfreaks.com/topic/100411-count-sessions/#findComment-513511 Share on other sites More sharing options...
ohdang888 Posted April 10, 2008 Author Share Posted April 10, 2008 so when will these files get deleted? or will they continue to pill up until i delete them? Link to comment https://forums.phpfreaks.com/topic/100411-count-sessions/#findComment-513531 Share on other sites More sharing options...
PFMaBiSmAd Posted April 10, 2008 Share Posted April 10, 2008 They get deleted when session garbage collection runs and they are older than the GC maxlifetime. For the complete information, read the session handling section in the php manual. http://php.net/session For your original question, if you state what you are trying to accomplish, someone might be able to tell you the best way of doing it. A session is only "active" depending on what your definition of "active" is. Web servers only receive http requests for pages. Once a page has been sent to a browser, the server goes on to service other http requests. It does not know or care what a person does in their browser or how long the look at a page... Link to comment https://forums.phpfreaks.com/topic/100411-count-sessions/#findComment-513537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.