Jump to content

How can i check all Sessions? or...


DarrenReeder

Recommended Posts

Hello,

 

I am trying to make a 'All players logged' on my site and i want to make it so i see all the sessions that are connected to the site, then dispay them all...

 

 

OR is it possible that if i have a field called 'logged' and When yuo connect it sets to '1' then if you close the browser/logout it sets to '0'? thiss seems a bit more dodgey though

Link to comment
Share on other sites

There is no way of changing a value via PHP when the user closes the browser or navigates away from your page, the only way that would work is if your users always use the logout link you provide for them. One way round it is to have a last_action value stored. Each time the user performs a request to your site, (ie loads a page, if you wish to allow people to idle you could use AJAX to force the requests) you update this timer, you can then either have a scipt ran via cRON jobs to remove inactive users every x amount of minutes or you can make clients trigger the action. In other words when somebody requests this list of 'online users' it trims it down before displaying it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.