Jump to content

PHP check devices connected to Wi-Fi


djchrisblue

Recommended Posts

Hello,

 

I got a web app on a local web server.

I got devices connected to the same network through Wi-Fi.

 

each device make a login first so I can store the timestamp of the login in mysql table.

devices are doing either

- log out

or

- simply get out of the Wi-Fi zone without log out.

in the 2nd case I still want to get the time it happens.

 

What do you suggest to get a more or less accurate time of logout?

 

Thanks in advance for help

 

Chris

 

Link to comment
Share on other sites

use ajax polling to send requests every x seconds to the server, when you initiate a session for a user then store that in a row in the database and each time this ajax request is received update that row to have "lastContactTime" set to the time of the ajax request... 

When a user logs in it will create a new row in the above table as it's a login request if they're logged out when they move outside of the network.

 

or, if whilst logged into the site, they're required to be clicking new pages frequently, then you can just ensure on each page load whilst logged in, you can skip the ajax polling and update the lastContactTime field each time a page is loaded and a user is logged in.

 

or i'm sure you could muster up a solution using socket.io though it may be overkill.

Edited by joel24
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.