javascriptphpimei

How to get a website connected device IMEI or MAC Address using PHP


I want to build a system where once user login, i get his connected device IMEI to store with login credentials. So how to get that connected device IMEI to restrict user for that 1 device in future logins.

I am Using Core PHP


Solution

  • You can't get the IMEI of a device using php, is just not possible. You can get the MAC of your clients only if they are connected in the same network as your server. If they are on the internet, you are not going to get their MAC, the MAC will be for the default gateway.

    If you want to restrict only one user, you can do like anybody else and use sessions for a valid user id like email and check if a session for that email is active and then either deny login or login the new device and delete the session for the previous one.